Skip to content

Instantly share code, notes, and snippets.

View allquixotic's full-sized avatar
🎯
Focusing

Sean McNamara allquixotic

🎯
Focusing
View GitHub Profile
@allquixotic
allquixotic / pcae.c
Last active December 13, 2015 19:39
//C99 program that prints out the supplied command line arguments and exits. WTFPL
//Compile with `gcc -std=c99 pcae.c -o pcae`
#include <stdio.h>
int main(int argc, char **argv)
{
for(int i = 0; i < argc; i++)
{
printf("argument %d: %s\n", i, argv[i]);
}
#!/bin/bash
directory=$(pwd)
pattern=$(awk -vORS=" " -v q="'" '{ print q $1 q }' .gitignore | sed 's/,$/\n/')
echo zip -r ignored $directory -i $pattern
zip -r ignored $directory -i $pattern
@allquixotic
allquixotic / gist:6194351
Last active December 20, 2015 20:59 — forked from hay/gist:1351230
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
background: white;
text-align: center;
padding: 20px;
font-family: Georgia, serif;
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
background: white;
text-align: center;
padding: 20px;
font-family: Georgia, serif;
<!doctype html><html lang="en-us"><head><meta charset="utf-8"><meta http-equiv="Content-Type" content="text/html;charset=utf-8"><title>Emscripten-Generated Code</title><style>.emscripten{padding-right: 0;margin-left: auto;margin-right: auto;display: block;}textarea.emscripten{font-family: monospace;width: 80%;}div.emscripten{text-align: center;}div.emscripten_border{border: 1px solid black;}/* the canvas *must not* have any border or padding, or mouse coords will be wrong */ canvas.emscripten{border: 0px none;}</style></head><body><hr/><div class="emscripten" id="status">Downloading...</div><div class="emscripten"><progress value="0" max="100" id="progress" hidden=1></progress></div><div class="emscripten_border"><canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas></div><hr/><div class="emscripten"><input type="checkbox" id="resize">Resize canvas <input type="checkbox" id="pointerLock" checked>Lock/hide mouse pointer    <input type="button" value="Fullscreen" onclick="Module
@allquixotic
allquixotic / gist:7553961
Last active December 28, 2015 19:59
how to install linux-vserver 3.10.19 patch vs2.3.6.8 on Debian Wheezy
  1. sudo apt-get install build-essential git
  2. sudo apt-get build-dep linux-image-$(uname -r) libncurses5-dev
  3. mkdir ~/dev; cd ~/dev
  4. wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.10.19.tar.xz
  5. wget http://vserver.13thfloor.at/Experimental/patch-3.10.19-vs2.3.6.8.diff
  6. tar xJf linux-3.10.19.tar.xz
  7. mv patch-3.10.19-vs2.3.6.8.diff linux-3.10.19
  8. cd linux-3.10.19
  9. git apply patch-3.10.19-vs2.3.6.8.diff
  10. cp /boot/config-* .config # CRITICAL STEP: Replace * with the latest vanilla kernel version you have installed from the Debian package repositories. Try ls /boot for info.
@allquixotic
allquixotic / gist:7677760
Last active December 29, 2015 13:29
browser crash ff linux
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>FF Linux SVG Browser Crash</title>
<script type="text/javascript">
var i = 0, j = 2500, removePrev = false;
var urls = ['http://openclipart.org/people/lalolalo/lalolalo_kagami_mochi.svg','http://openclipart.org/people/lijenhsin/lijenhsin_head_mirror.svg','http://openclipart.org/people/johnny_automatic/johnny_automatic_mirror_drawing.svg','http://openclipart.org/people/milker/milker_Can_You_See_Me_.svg','http://openclipart.org/people/barthm8s/barthm8s_Heiko-Barth_GlassButton_Mirror_Shadow.svg','http://openclipart.org/people/sophokles/sophokles_Yet_another_arrow_2.svg','http://openclipart.org/people/eeyrsja/eeyrsja_Disco_Ball.svg','http://openclipart.org/people/Anonymous/Anonymous_Disco_ball.svg','http://openclipart.org/people/tom/tom_2_fold_symmetry.svg','http://openclipart.org/people/tom/tom_4_fold_symmetry.svg','http://openclipart.org/people/tom/tom_kaleidoscope_3_fold_symmetry.svg','http://openclipart.org/people/tom/tom_kaleidoscope_in
@allquixotic
allquixotic / crash.svg
Created November 27, 2013 20:13
Firefox worst-case svg behavior - memory balloons and CPU pegs - https://bugzilla.mozilla.org/show_bug.cgi?id=943985
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@allquixotic
allquixotic / gist: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
Created January 3, 2014 13:39
properly sanitized zombie.js bot this time
// Make sure we got a filename on the command line.
if (process.argv.length < 3) {
console.log('Usage: node ' + process.argv[1] + ' FILENAME');
process.exit(1);
}
// Read the file and print its contents.
var fs = require('fs')
, filename = process.argv[2]
, happy = "";
fs.readFile(filename, 'utf8', function(err, data) {