Skip to content

Instantly share code, notes, and snippets.

@Ricket
Ricket / README
Last active October 10, 2015 04:03
Aura Cascade 552 crash Ticking block entity
Bug filed here: https://github.com/pixlepix/Aura-Cascade/issues/93
@Ricket
Ricket / keybase.md
Created April 2, 2014 02:50
keybase.md

Keybase proof

I hereby claim:

  • I am Ricket on github.
  • I am ricket (https://keybase.io/ricket) on keybase.
  • I have a public key whose fingerprint is AFD3 970F 6E7E 3737 7EA9 FE4F 3996 81F2 B4AA 9007

To claim this, I am signing this object:

@Ricket
Ricket / backup_dokuwiki
Created July 1, 2012 03:55
Arch Linux DokuWiki backup to Amazon S3
#!/usr/bin/env ruby
# DokuWiki backup for Arch Linux; daily rotating logs, weekly permanent log.
# Fix the Amazon credentials and bucket name, and if desired, the wiki path.
# Copied with modifications from:
# http://www.dokuwiki.org/tips:backuptos3
# Save this script to: /etc/cron.daily/backup-dokuwiki
@Ricket
Ricket / wrapwget.sh
Created April 13, 2012 15:16
wgetting NCSU WRAP-ped sites
#!/bin/bash
URL="$1"
read -p "Username: " USERNAME
read -s -p "Password: " PASSWORD
echo -e ".ncsu.edu\tTRUE\t/\tFALSE\t0\tWRAP_REFERER\t$URL" > cookies.txt
wget --post-data="userid=$USERNAME&userpw=$PASSWORD&onproxy=N" --cookies=on --keep-session-cookies –-no-check-certificate --load-cookies=cookies.txt --save-cookies=cookies.txt "https://webauth.ncsu.edu/wrap-bin/was16.cgi?auth"
@Ricket
Ricket / gist:2044441
Created March 15, 2012 14:23
Three.js mouse picking
var projector = new THREE.Projector();
var ray = projector.pickingRay( mouseCoord, camera ); // (mouse coord are in screenspace and must be [-1, 1])
var objects = ray.intersectObjects( scene.children );
if( objects.length )
{
objects[ 0 ].object; // THREE.Particule or THREE.Mesh
objects[ 0 ].face; // THREE.Face3 or THREE.Face4 (is .object is a Mesh
objects[ 0 ].point; // THREE.Vector3
}
@Ricket
Ricket / spinningsquare.c
Created February 26, 2012 18:42
OpenGL Spinning Square
// spinningsquare.c
// compiles on OSX with:
// gcc spinningsquare.c -framework glut -framework opengl -o spinningsquare
#include <stdlib.h>
#ifdef __APPLE__
# include <GLUT/glut.h>
#else
# include <GL/glut.h>
#endif
@Ricket
Ricket / config.log
Created September 19, 2011 01:11
msgpack failed attempt to compile 32-bit
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure CFLAGS=-bundle -arch i386 -arch x86_64 CXXFLAGS=-bundle -arch i386 -arch x86_64
## --------- ##
## Platform. ##
@Ricket
Ricket / gist:1205383
Created September 9, 2011 02:53
My notes from Douglas Crockford's speech "JavaScript Programming Style & Your Brain"
Douglas Crockford
Sr. JavaScript Architect, Yahoo!
JavaScript Programming Style & Your Brain
He made JSLint
Prefer forms that are error resistant and more reliable
return
{
@Ricket
Ricket / RightToLeftTest.java
Created August 24, 2011 23:23
Correcting the notion that Java's assignment statements are evaluated "right to left."
/**
* This program proves that expressions are evaluated left to right; assignment
* statements, therefore, are evaluated left-to-right on the right side of the
* equals sign (since that's just an expression) and then assigned to the
* thing to the left of the equals sign.
*
* So when a professor tells you that assignment statements are evaluated
* right-to-left, it doesn't mean each symbol in the statement is evaluated
* in the order from right to left, just that the stuff on the right is assigned
@Ricket
Ricket / ServerManagedPolicy.java
Created August 22, 2011 23:38
Modified ServerManagedPolicy which only requires licensing to be verified every 7 days or 10 tries. (from the Android licensing library)
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software