This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!doc.containsKey('myfield') || doc['myfield'].empty) { return "unavailable" } else { return doc['myfield'].value } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// kkrotchbulge: a cheap nasty hack to capture 60fps vids on Linux & BSD systems / GreaseMonkey, 2015 - Public Domain | |
// note, only does video right now, and only handles SDL2 + GL. | |
// compile+render: cc -fPIC -shared -o libkkrotchbulge.so kkrotchbulge.c -I/usr/local/include `sdl2-config --cflags` -L/usr/local/lib -lGL && env LD_PRELOAD=./libkkrotchbulge.so ./tfiy | |
// transcode (in another terminal): ffmpeg -s 1280x720 -r 60 -pix_fmt rgba -f rawvideo -i kkrotchbulge-out-vid tfiy-vid.mkv | |
// combine audio: ffmpeg -i tfiy-vid.mkv -i dat/ds15rel-gm.ogg -acodec copy -vcodec copy tfiy-60fps.mkv | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <errno.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you are running a large website where you will need to test new features on a seperate url before pushing them live then the following instructions are for you ;) | |
For this example imagine your url is apple.com and you want a development/staging site on a subdomain which is dev.apple.com | |
#Setup# | |
1. First thing you'll want to do is go ahead and create your website in plesk and add the subdomain dev.apple.com at the same time. | |
2. ssh into the server e.g. $ ssh username@ipaddress | |
3. Once logged in cd into the private directory (this will be where all git repos are stored) e.g. $ cd ~/private | |
4. Create the main repo e.g. $ git init --bare apple.git | |
5. Now to clone this new repo on your local machine. $ git clone ssh://username@ipaddres/~/private/apple.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |