Skip to content

Instantly share code, notes, and snippets.

@p01
p01 / LICENSE.txt
Last active March 9, 2024 13:40 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@lrvick
lrvick / manual_nltk_bayes_classify.py
Created October 6, 2011 04:59 — forked from tsoporan/manual_nltk_bayes_classify.py
Manually train an NLTK NaiveBayes Classifier
from nltk.probability import ELEProbDist, FreqDist
from nltk import NaiveBayesClassifier
from collections import defaultdict
train_samples = {
'I hate you and you are a bad person': 'neg',
'I love you and you are a good person': 'pos',
'I fail at everything and I want to kill people' : 'neg',
'I win at everything and I want to love people' : 'pos',
'sad are things are heppening. fml' : 'neg',
@jrom
jrom / nginx.conf
Created February 7, 2012 17:14
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
@emiller
emiller / git-mv-with-history
Last active April 17, 2024 21:06
git utility to move/rename file or folder and retain history with it.
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
@kriserickson
kriserickson / gist:8044290
Last active December 31, 2015 20:59
Using Ajax instead of getBase64Image to load images... See: http://jsfiddle.net/ksoncan34/DQYR2/3/
// See: http://jsfiddle.net/ksoncan34/DQYR2/3/
// Get an objectURL with an ajax object...
function getAjaxObjectUrl(url, callback, error) {
var xhr = new XMLHttpRequest(),
blob, objectURL, arrayBufferView;
xhr.open('GET', url, true);
xhr.responseType = 'arraybuffer';
xhr.addEventListener('load', function () {
@fcamblor
fcamblor / README.md
Last active January 11, 2023 06:46 — forked from rxx/README.md

agnoster-fcamblor.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@aheckmann
aheckmann / parallelism.js
Created January 28, 2015 02:25
configurable parallelism
/**
* example of configurable parallelism
*/
// silly counter
var i = 0;
// configurable amount of work to run in parallel
var max = 1;
@FrankSpierings
FrankSpierings / README.md
Last active January 20, 2024 20:45
Linux Container Escapes and Hardening
% aapt dump xmltree SprintDM.apk AndroidManifest.xml
N: android=http://schemas.android.com/apk/res/android
E: manifest (line=2)
A: android:sharedUserId(0x0101000b)="android.uid.phone" (Raw: "android.uid.phone")
A: android:versionCode(0x0101021b)=(type 0x10)0x1
A: android:versionName(0x0101021c)="1.0" (Raw: "1.0")
A: package="com.android.sdm.plugins.sprintdm" (Raw: "com.android.sdm.plugins.sprintdm")
A: platformBuildVersionCode=(type 0x10)0x19 (Raw: "25")
A: platformBuildVersionName="7.1.2" (Raw: "7.1.2")
E: uses-sdk (line=8)
#include "ergodox_ez.h"
#include "debug.h"
#include "action_layer.h"
#include "version.h"
#include "keymap_german.h"
#include "keymap_nordic.h"