Skip to content

Instantly share code, notes, and snippets.

View omersiar's full-sized avatar

Ömer Şiar Baysal omersiar

  • Earth
View GitHub Profile
//
// 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)
//
@mediabeastnz
mediabeastnz / Staging&ProductionUsingGit
Last active December 1, 2022 14:47
Staging and Production Server using Git.
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
@iamgreaser
iamgreaser / kkrotchbulge.c
Created November 11, 2015 21:05
kkrotchbulge - SDL2+GL capture on Linux & BSD
// 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>
@jclosure
jclosure / contains_key_or_empty.txt
Created July 3, 2017 05:33
Kibana Painless scripted field checks if field exists or is empty and returns default, otherwise value
if (!doc.containsKey('myfield') || doc['myfield'].empty) { return "unavailable" } else { return doc['myfield'].value }