Skip to content

Instantly share code, notes, and snippets.

View Nullreff's full-sized avatar

Nullreff Nullreff

View GitHub Profile
@Nullreff
Nullreff / First Guy
Last active December 14, 2015 03:19
Morse code brute force solver
# ruby morse-solver.rb "-...--.-."
bgn
bgte
bmae
bmen
bmete
bmr
bqe
btc
btke
@Nullreff
Nullreff / graph.sql
Last active December 31, 2018 03:51
Graphing program written in T-SQL
/* Cool graphing program in T-SQL
* licensed under Creative Commons Attribution-ShareAlike
*
* Change line 17 to the equation you want to graph and
* line 18 to the equation of its slope (derivative).
* Example at: http://sqlfiddle.com/#!3/d41d8/12830
*/
WITH
XVals(X) AS (
// Called whenever you press "Reload Comic"
function reload_comic(){fetch_and_set("http://prizes.prequeladventure.com/wlf2/qwtake-control-data.json", '#comic', "#votes", ".comicadjustment");}
function fetch_and_set(url, target, votes, domadjust ) {
jQuery.getJSON(url, function (data) {
/* Data is:
* f: Url with a bunch of data, seems to always be:
* "http://prizes.prequeladventure.com/wlf2/qwtake-control-crypt.txt"
*
define_weapon :magic_sword do
name 'Magic Sword'
description 'This sword burns 30 mana per hit'
damage 20
durability 40
enchant_with :knockback_II, :looting_III
on_damage do |attacker, target|
BURN = 30
class A
{
public static implicit operator int(A a) { return 0; }
public static bool operator -(bool a, A b) { return true; }
static void Main()
{
// Including null
var a = true is bool? -new A() is bool? null : default(bool?);
@Nullreff
Nullreff / fullscreen.js
Last active August 29, 2015 13:56
Fullscreen 'n stuff
// Optionally switch to full sized chat
jQuery('#chatbox').attr('src', jQuery('#chatbox').attr('src').split('&')[0]);
// Fullscreen the chat and stream
jQuery('#chatbox').detach().appendTo('body').attr({'height': '100%', width: '300px'}).css('float', 'right');
jQuery('#myPlayerElement_wrapper').detach().appendTo('body').removeAttr('style').css({'overflow': 'hidden', 'height': '100%'});
// Hide everything else
jQuery('#site-content').hide();
@Nullreff
Nullreff / code.txt
Created March 15, 2014 07:26
DBZA 40 Code
01001011 - 75 K
01001001 - 73 I
01001100 - 76 L
01001100 - 76 L
00100000 - 32
01010011 - 83 S
01001111 - 79 O
01001110 - 78 N
00100000 - 32
01000111 - 71 G
@Nullreff
Nullreff / install-krita.sh
Last active December 25, 2016 03:30
Krita on Debian
#!/bin/sh
# See http://www.davidrevoy.com/article193/guide-building-krita-on-linux-for-cats
# Directory setup
SOURCE=~/src/software/calligra
BUILD=~/src/software/krita
INSTALL=/opt/krita
mkdir -p $SOURCE $BUILD $INSTALL
# Install dependencies
@Nullreff
Nullreff / share.sh
Created September 15, 2014 17:42
File Sharing
#!/bin/bash
# Uploads a list of files to a server and prints their urls for sharing.
UPLOAD_PATH="server:~/path/to/web/root/"
URL_PATH="http://example.com"
echo "Uploading `echo "$@" | wc -w` file(s)..."
rsync -rcuP --chmod=u+rw,g+r,o+r "$@" $UPLOAD_PATH || exit
echo '=== Links ==='
for FILE in "$@"; do
@Nullreff
Nullreff / home.css
Created October 6, 2014 17:00
Website
#welcome {
width: 800px;
margin: 20px auto;
padding: 20px;
}
p.links > a {
text-decoration: none;
color: black;
margin-left: 10px;