Skip to content

Instantly share code, notes, and snippets.

View wtfaremyinitials's full-sized avatar

Will Franzen wtfaremyinitials

View GitHub Profile
@EpokK
EpokK / dnd.js
Created November 24, 2014 14:29
dnd js natif with angularJS
var app = angular.module('dragDrop', []);
app.directive('draggable', function() {
return function(scope, element) {
// this gives us the native JS object
var el = element[0];
el.draggable = true;
el.addEventListener(
@aemkei
aemkei / LICENSE.txt
Created November 2, 2011 19:27 — forked from 140bytes/LICENSE.txt
minesweeper - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
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
var gulp = require('gulp');
var exec = require('child_process').exec;
gulp.task('default', function (cb) {
exec('sketchtool export slices assets/icons.sketch --output=assets/icons/', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
});
@shibumi
shibumi / PKGBUILD
Created October 7, 2015 16:32
PKGBUILD for N1 Mailclient
# Maintainer: Christian Rebischke <echo Q2hyaXMuUmViaXNjaGtlQGdtYWlsLmNvbQo= | base64 -d>
_pkgname='N1'
pkgname='n1-git'
pkgver=..0edbf51
pkgrel=1
pkgdesc="An extensible mail client built on the modern web"
arch=('any')
url="https://github.com/mbilker/N1/tree/node-v4"
license=('')
depends=('nodejs' 'npm')
// % swift qrcli.swift TEST > qrcode.png
// or, % swift build -Xswiftc -framework -Xswiftc CoreImage
import CoreImage
import class AppKit.NSBitmapImageRep
func qrcode(_ text: String) -> CIImage {
let filter = CIFilter(name: "CIQRCodeGenerator")!
filter.setValue(text.data(using: .shiftJIS), forKey: "inputMessage")
filter.setValue("M", forKey: "inputCorrectionLevel")
@isaacs
isaacs / http-example-client.js
Created December 1, 2010 08:35
a simple example of a nodejs http client making a POST request
var http = require("http")
, util = require("sys") // 0.3.x: require("util")
, fs = require("fs")
, client = http.createClient(80, "example.com")
, request = client.request("POST", "/", {"host":"example.com"})
// send body chunks
request.write("hello, world")
// pump a file through
@EddyVerbruggen
EddyVerbruggen / iOS8 Beta Phonegap fix
Last active December 8, 2018 05:28
iOS8 Beta Phonegap fix: manually set the navigator.userAgent
// temp fix for iOS8 beta 1 (fixed in beta 2), add it after the reference to cordova.js
if (navigator.userAgent === undefined) {
navigator.__defineGetter__('userAgent', function() {
return("Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit");
});
}
#!/bin/sh
KERNEL="vmlinuz-4.4.0-112-generic"
INITRD="initrd.img-4.4.0-112-generic"
CMDLINE="earlyprintk=serial console=ttyS0 acpi=off root=/dev/vda1 ro"
MEM="-m 1G"
SMP="-c 2"
NET="-s 2:0,virtio-net"
IMG_HDD="-s 4,virtio-blk,hd.raw"
@aadnk
aadnk / LightSourceEx.java
Created June 22, 2013 18:17
LightSource Advanced - Update nearby chunks as well, but only if necessary.
package com.comphenix.example;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.List;
import net.minecraft.server.v1_5_R3.Entity;
import net.minecraft.server.v1_5_R3.EntityHuman;
import net.minecraft.server.v1_5_R3.EnumSkyBlock;
import net.minecraft.server.v1_5_R3.IWorldAccess;
@banjun
banjun / main.swift
Created February 14, 2017 07:36
add Touch Bar support for CLI without .app bundle nor Info.plist
class AppDelegate: NSResponder, NSTouchBarDelegate, NSApplicationDelegate {
@available(OSX 10.12.2, *)
lazy var touchbar: NSTouchBar = {
let tb = NSTouchBar()
tb.delegate = self
tb.defaultItemIdentifiers = [NSTouchBarItemIdentifier(rawValue: "test")]
return tb
}()