Skip to content

Instantly share code, notes, and snippets.

@possan
possan / generate.sh
Last active December 25, 2015 22:19
But why
#!/bin/sh
rm icon*.png
rm splash-*png
echo "icons, ios..."
convert base-icon.png -resize 152x152 -sharpen 0x.6 icon152.png
convert base-icon.png -resize 144x144 -sharpen 0x.6 icon144.png
convert base-icon.png -resize 120x120 -sharpen 0x.6 icon120.png
convert base-icon.png -resize 114x114 -sharpen 0x.6 icon114.png
WWWWWWWWWWWWWWW&NHH?Yz<<+?<)+++>av/))<=+<v<<<>(>^' _/,;="=""==>?!44W&W&NNBHHHHHW[<<>9WHW&NHHHHHHHHHHHHHHHHHH4WWWWWW&NWWWWWWWWWW
WWWWWWWWWWWW&HGH??<<?<<<v<=<<<<<><<>,<:==<",<)(<<,;' ,<;==" "=!H!BWHHHHHW[<<<<)QH4HHHHHHHHHHHHHHHHHHHHWWWWWW&HH4WWWWWWWWW
WWWWWWWWW&BHHt[s<>vvvnaavvvv,;"^7<><=;:<< ;';<<<"" : : _ :'""" "':<7x]WHHHWR<<<<<+4HHHHHHHHHHHHHHHHHHHHH4WWWWWWBQQWWWWWWWWWW
WWWWWWWWBHOiaaa+7????<+++<<<<<<<vv;<; ,,,_=;,,_- _ _ _,; :>v29WQW&(<<<<<)3&HHHHHHHHHHHHHHHHHHHH44WWWW&HQWNB4NWWWWWW
WWWWWW&H?YJHHHO?+7(<><(^=<)+<<<;<=""""<-=' "=":<,_,,;>< _=__ ' _' _" =s>=4BO<<<<<<)+BHHHHHHHHHHHHHHHHHHHH4WWWWWWWW&HHHWWWWWWW
WWWWWNOJHNO?+++++v<<;,,,,,,, :"""" :<,<<<<;,,:;='':<<; ,,_"' ;\;= " ; , - <=>^++<<<<<<<+HHHHHHHHHHHHHHHHHHHH4WWWWWWWWWWQQWWWWWWWW
WWWWWHHO+7++++sv+<(><<<<<<=' ' _,,><<<<<<<<_</<><< =-" _'_<>7'_;'___;;:,=, _ <:"'<(<<<<<<<)HHHHHHHHHHHHHHHHHHHH4WWWWWWWWWWWWWWWWWWWW
WWW&H?GaJ??[<<<<,,,,/==<;;<,_ :':;<<;<<===;<<=;
@possan
possan / gist:8076396
Last active January 1, 2016 01:59
Orkade inte få ner den mer än till 400 bytes
var d=document,b=d.body,R=Math.random;b.style.background="#001",b.style.color="#F31",b.innerHTML="God Jul, Kodapor!",c=300;while(c--)(function(){var e=b.appendChild(d.createElement("b")),t=e.style,n=0,r=R(),i=R()*1500,s=R()*800,o=3+2*R();e.innerHTML="*",t.position="absolute",t.color="#fff",t.opacity=R(),setInterval(function(){t.top=(s+=o)%800+"px",t.left=i+90*Math.sin(n+=r/50)+"px"},20)})();
it('it knows when players should select categories and set questions', function() {
var g = new Game();
g.setupTwoPlayerGame(player1, player2);
assert.equal(true, g.canSetRoundQuestions(player1.id), 'canSetRoundQuestions P1 should return true');
assert.equal(false, g.canSetRoundQuestions(player2.id), 'canSetRoundQuestions P2 should return false');
g.setRoundQuestions(player1.id, 'x', 'y', [{ id:1, text:'question 1', alternatives: [] }]);
assert.equal(false, g.canSetRoundQuestions(player1.id));
assert.equal(false, g.canSetRoundQuestions(player2.id));
<html><body><style> div#anim1 b { display: inline-block; width: 1px; height: 1px; } @-webkit-keyframes p340 { 0%% { background: rgb(0,0,0); } 4.714285714285714%% { background: rgb(0,0,0); } 9.428571428571429%% { background: rgb(0,0,0); } 14.142857142857142%% { background: rgb(8,16,8); } 18.857142857142858%% { background: rgb(0,0,0); } 23.571428571428573%% { background: rgb(0,0,0); } 28.285714285714285%% { background: rgb(0,0,0); } 33%% { background: rgb(0,0,0); } 37.714285714285715%% { background: rgb(0,0,0); } 42.42857142857143%% { background: rgb(0,0,0); } 47.142857142857146%% { background: rgb(0,0,0); } 51.857142857142854%% { background: rgb(0,0,0); } 56.57142857142857%% { background: rgb(0,0,0); } 61.285714285714285%% { background: rgb(0,0,0); } 66%% { background: rgb(0,0,0); } 70.71428571428571%% { background: rgb(0,0,0); } 75.42857142857143%% { background: rgb(0,0,0); } 80.14285714285714%% { background: rgb(0,0,0); } 84.85714285714286%% { background: rgb(0,0,0); } 89.57142857142857%% { background: rgb(0
@possan
possan / list-ipa-udid.sh
Created August 25, 2014 18:42
Simple script to list the allowed UDID's inside an apple IPA package, to verify it's going to work on a specific users device.
#!/bin/sh
#
# Simple script to print out UDID's in apple IPA packaged apps.
#
# Syntax: list-ipa-udid.sh {my-application.ipa}
#
IPA=$1
@possan
possan / stick.ino
Created September 9, 2014 21:31
Simple arcade stick controller thingy for Arduino, emulating an keyboard, sending arrow key events
const int leftButton = 4;
const int rightButton = 5;
const int upButton = 6;
const int downButton = 3;
const int enterButton = 7;
const int ledPin = 12;
class Debouncer {
private:
int time;
@possan
possan / ledpanel.js
Created September 10, 2014 22:22
64x32 ledpanel driver for node.js
var SerialPort = require("serialport");
// https://github.com/tompreston/4x5-Font/blob/master/4x5-font.js
var font4x5 = {
'': [0x0, 0x0, 0x0, 0x0, 0x0],
'!': [0x4, 0x4, 0x4, 0x0, 0x4],
'#': [0x6, 0xf, 0x6, 0xf, 0x6],
'\'': [0x0, 0xa, 0x0, 0x0, 0x0],
'%': [0x7, 0xe, 0x4, 0x7, 0xe],
'$': [0x7, 0xa, 0x6, 0x5, 0xe],
@possan
possan / ledpanel.ino
Created September 10, 2014 22:22
64x32 ledpanel driver
// PINS
// OE A
// - B
// - -
// - CLK
// - SCLK
// - -
// - R
// - -
var SerialPort = require("serialport");
var moment = require('moment');
// https://github.com/tompreston/4x5-Font/blob/master/4x5-font.js
var font4x5 = {
'': [0x0, 0x0, 0x0, 0x0, 0x0],
'!': [0x4, 0x4, 0x4, 0x0, 0x4],
'#': [0x6, 0xf, 0x6, 0xf, 0x6],
'\'': [0x0, 0xa, 0x0, 0x0, 0x0],
'%': [0x7, 0xe, 0x4, 0x7, 0xe],