Skip to content

Instantly share code, notes, and snippets.

@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
<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
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));
@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)})();
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 / 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
llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllloooooooooooooooooolllllllooooooolllllllllllllllllllllllllll
lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllloooooooooooooollllllllloolllllllllllllllllllllllllllllllll
lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllooooollllllllllllllllllllllllllllllllllllllllllllllll
llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
lllllllllllllllllllllllllcccc::::ccclllllllllllllllllllllllllllllllllllllllllooollllllllllllllllllllllllllllllllllllllll
lllllllllllllllllllllllc:;,''......',;;:cclllllloooolllllllllllllllllllllllllooollllllllllllllllllllllllllllllllllllllll
oooooooooooollllllllllc:,'............',,;::lloooooolllllllllllllllllllllllllllllllllllllllllllllllllllllllllloooooollll
oooooolllloolllllllc:;,,,;:clll:;;,'......';:lllllllllllllllolllllllllllllllllllllllllllllllllllllllllllllloooooolllllll
oooooollllllllllllcc:c:codkOxdlc::;;,'......',;:lllllooo
@possan
possan / stocks.js
Last active December 23, 2015 09:19
var sys = require('util');
var rest = require('restler');
var fs = require('fs');
var database = {};
var list = [ 'AAPL', 'IBM', 'GE' ];
var done = 0;
function save_all_tickers() {
console.log('done, all data:', database);
@possan
possan / knightrider.sh
Created September 1, 2013 18:23
Led test for chromebook pixel lightbar
#!/bin/bash
led() {
IDX=$1
RGB=$2
# echo "led $IDX $RGB"
R="${RGB:0:1}"
G="${RGB:1:1}"
B="${RGB:2:1}"
-- haskell plasma attempt
-- compile with: ghc plasma.hs
-- run: plasma 80 50
import Data.Maybe
import Data.List
import System.Posix.Unistd
import System.Environment
coordValue :: Float -> Float -> Float -> Float