Skip to content

Instantly share code, notes, and snippets.

View rossy's full-sized avatar
👊
平気、へっちゃら!

James Ross-Gowan rossy

👊
平気、へっちゃら!
View GitHub Profile
@rossy
rossy / gist:1906893
Created February 25, 2012 06:24
MPlayer2 output
C:/Users/Rossy/AppData/Local/SMPlayer2/mplayer2-i386.exe -noquiet -v -nomouseinput -sub-fuzziness 1 -identify -slave -vo gl3:srgb:lscale=lanczos3:cscale=lanczos2 -ao dsound -nokeepaspect -priority realtime -framedrop -dr -double -wid 524694 -monitorpixelaspect 1 -subcp UTF-8 -subpos 100 -volume 100 -nocache -osdlevel 0 -vf-add screenshot -noslices -channels 6 -format s24le D:/Rossy/itunes/compare.avs
MPlayer2 d44435a (C) 2000-2012 MPlayer Team
built 2012-02-23 on Patchouli (running openSUSE 12.1 (x86_64) 'Asparagus')
CPU vendor name: GenuineIntel max cpuid level: 11
CPU: Intel(R) Core(TM) i5 CPU 650 @ 3.20GHz (Family: 6, Model: 37, Stepping: 2)
extended cpuid-level: 8
extended cache-info: 16801856
@rossy
rossy / README.md
Created March 23, 2012 02:35
threadstatistics.user.js

4chan thread statistics

Click here to install. Firefox users should install Scriptish first.

@rossy
rossy / colour.js
Created April 27, 2012 03:56
colour.js
function srgb2lrgb(r, g, b)
{
if (r instanceof Array)
{
b = r[2];
g = r[1];
r = r[0];
}
return [
@rossy
rossy / solarizedchan.css
Created May 27, 2012 10:51
Solarized theme for [code] tags on /g/.
pre.prettyprint .str { color: #859900 !important; }
pre.prettyprint .kwd { color: #268bd2 !important; }
pre.prettyprint .com { color: #cb4b16 !important; font-style: italic; }
pre.prettyprint .typ { color: #2aa198 !important; }
pre.prettyprint .lit { color: #dc322f !important; }
pre.prettyprint .pun { color: #2aa198 !important; }
pre.prettyprint .pln { color: #839496 !important; }
pre.prettyprint .tag { color: #6c71c4 !important; }
pre.prettyprint .atn { color: #268bd2 !important; }
pre.prettyprint .atv { color: #2aa198 !important; }
@rossy
rossy / closure.c
Created June 17, 2012 06:20
GCC Lexical Closures
#include <stdio.h>
void sayHello(void (*log)(char*))
{
log("Hello, world!");
}
int main(int argc, char** argv)
{
void log(char* message)
#!/system/xbin/sh
cd /data/local/arch
echo rainbow > /proc/sys/kernel/hostname
if ! mountpoint -q dev; then
mount -t proc /proc proc
mount -t sysfs sysfs sys
mount -o bind /dev dev
@rossy
rossy / SublimeClang.sublime-settings
Created August 31, 2012 01:31
MinGW SublimeClang configuration
{
"show_output_panel": false,
"dont_prepend_clang_includes": true,
"additional_language_options":
{
"c++" :
[
"-std=gnu++11",
"-isystem", "C:\\cygwin\\usr\\i686-w64-mingw32\\sys-root\\mingw\\include\\c++\\4.8.0",
@rossy
rossy / merge.js
Created September 14, 2012 13:24
require("child_process").spawn(
"montage",
require("fs")
.readdirSync(".")
.map(function(a) {
return a.match(/^.*_Tile_([-\d]{3})_([-\d]{3})_LOD0\.dds$/);
})
.filter(function(a) { return a; })
.sort(function(a, b) {
var x1 = Number(a[1]),
@rossy
rossy / loadlibrary_system.c
Created June 25, 2013 07:08
Safe LoadLibrary for DLLs that are expected to be in system32
#include <windows.h>
#include <wchar.h>
#define LOAD_LIBRARY_SEARCH_SYSTEM32 (0x00000800)
HMODULE loadlibrary_system(const wchar_t* name)
{
/* If running on Windows 8 or a system with KB2533623, LoadLibraryEx with
LOAD_LIBRARY_SEARCH_SYSTEM32 does the right thing */
if (GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "AddDllDirectory"))
@rossy
rossy / timer.c
Created July 3, 2013 07:24
Query the interrupt timer in Windows without any API calls.
#include <inttypes.h>
#include <stdio.h>
static uint64_t get_interrupt_time()
{
const void* const shared_user_data = (void*)0x7ffe0000;
const volatile struct {
uint32_t low;
uint32_t high1;
uint32_t high2;