Skip to content

Instantly share code, notes, and snippets.

View xkisu's full-sized avatar
🏳️‍⚧️

Keith Mitchell xkisu

🏳️‍⚧️
View GitHub Profile
@ciembor
ciembor / gist:1494530
Created December 18, 2011 21:28
RGB to HSL and HSL to RGB conversion functions
#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;
@tallica
tallica / gtkrc
Last active September 5, 2022 06:22
gtk2 dark theme
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
@davedoesdev
davedoesdev / .gitignore
Created November 12, 2012 07:55
Using Webkit from GTK+/Vala
webkit-example
@joemiller
joemiller / netpps.sh
Last active January 12, 2024 15:39
shell: quick linux scripts for showing network bandwidth or packets-per-second
#!/bin/bash
if [ -z "$1" ]; then
echo
echo usage: $0 network-interface
echo
echo e.g. $0 eth0
echo
echo shows packets-per-second
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)
@keijiro
keijiro / ScreenRecorder.cs
Last active January 26, 2022 05:01
Screen recording utility.
using UnityEngine;
using System.Collections;
public class ScreenRecorder : MonoBehaviour
{
public int framerate = 30;
public int superSize;
public bool autoRecord;
int frameCount;
@GuillermoPena
GuillermoPena / nodeJs.crypto.calculatingHash.js
Created February 26, 2014 16:30
NodeJS - CRYPTO : How to calculate a hash from file or string
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"
@whitlockjc
whitlockjc / rgbaToHex.js
Last active July 18, 2022 10:25
Use JavaScript to Convert RGBA CSS Value to Hexadecimal
#!/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,'');
@Brick85
Brick85 / somagic_rec_and_play.sh
Created July 21, 2014 11:50
somagic record and play
#!/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
@adrian-gierakowski
adrian-gierakowski / sfml_skia.cpp
Last active November 11, 2018 07:56 — forked from zester/gist:2593564
using SFML with Skia
#include <SFML/Graphics.hpp>
// include skia
#include "SkCanvas.h"
#include "SkGraphics.h"
#include "SkImageEncoder.h"
#include "SkString.h"
#include "SkTemplates.h"
#include "SkTypeface.h"