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
#define MIN(a,b) ((a)<(b)?(a):(b)) | |
#define MAX(a,b) ((a)>(b)?(a):(b)) | |
typedef struct rgb { | |
float r, g, b; | |
} RGB; | |
typedef struct hsl { | |
float h, s, l; | |
} HSL; |
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
gtk-color-scheme = "base_color:#4F524F\nfg_color:#eeeeec\ntooltip_fg_color:#eeeeee\nselected_bg_color:#3465a4\nselected_fg_color:#eeeeec\ntext_color:#EEEEEC\nbg_color:#363B3B\ntooltip_bg_color:#000000" | |
gtk-auto-mnemonics = 1 | |
style "default" { | |
xthickness = 1 | |
ythickness = 1 | |
####################### | |
# Style Properties |
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
webkit-example |
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
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo | |
echo usage: $0 network-interface | |
echo | |
echo e.g. $0 eth0 | |
echo | |
echo shows packets-per-second |
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
import csv, httplib, json | |
from string import ascii_lowercase | |
con = httplib.HTTPSConnection('api.github.com') | |
languages = ['java', 'c', 'ruby', 'python', 'javascript'] | |
for lang in languages: | |
with open(lang + '.csv', 'wb') as csvfile: | |
csvwriter = csv.writer(csvfile, delimiter = ',', quotechar='"', quoting = csv.QUOTE_MINIMAL) | |
for ch in ascii_lowercase: | |
print("Processing repos with " + ch + " for language " + lang) |
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
using UnityEngine; | |
using System.Collections; | |
public class ScreenRecorder : MonoBehaviour | |
{ | |
public int framerate = 30; | |
public int superSize; | |
public bool autoRecord; | |
int frameCount; |
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
var crypto = require('crypto') | |
, fs = require('fs') | |
// Algorithm depends on availability of OpenSSL on platform | |
// Another algorithms: 'sha1', 'md5', 'sha256', 'sha512' ... | |
var algorithm = 'sha1' | |
, shasum = crypto.createHash(algorithm) | |
// Updating shasum with file content | |
var filename = __dirname + "/anything.txt" |
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
#!/usr/bin/env node | |
// Takes an rgba() CSS value and converts it to its 8 digit hexadecimal value. | |
// | |
// Usage: ./rgbaToHex.js "{YOUR_RGBA_STRING}" | |
// | |
// Example: ./rgbaToHex.js "rgba(197, 200, 198, .2)" => #C5C8C633 | |
function trim (str) { | |
return str.replace(/^\s+|\s+$/gm,''); |
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
#!/bin/sh | |
PIPE=/tmp/somagic-pipe | |
OUTFILEDIR=~/dirs/Videos/ | |
LOGDIR=~/.somagic-log/ | |
NOW=`date +"%m_%d_%Y_%H_%M_%S"` | |
OUTFILE=${OUTFILEDIR}fpv_video_${NOW}.mp4 | |
mkdir $LOGDIR |
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
#include <SFML/Graphics.hpp> | |
// include skia | |
#include "SkCanvas.h" | |
#include "SkGraphics.h" | |
#include "SkImageEncoder.h" | |
#include "SkString.h" | |
#include "SkTemplates.h" | |
#include "SkTypeface.h" |
OlderNewer