Skip to content

Instantly share code, notes, and snippets.

View walm's full-sized avatar

Andreas Wålm walm

  • Sweden
View GitHub Profile
@walm
walm / AppDelgate.m
Created April 3, 2012 12:01
UIWebView remote debugging
- (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
[NSClassFromString(@"WebView") _enableRemoteInspector];
/** .. do your AppDelgate thing.. **/
return YES;
}
@walm
walm / Monaco_Linux-Powerline.ttf
Created April 19, 2012 13:23 — forked from dsc8x/Monaco_Linux-Powerline.ttf
Monaco for vim-powerline
@walm
walm / AppDelegate.m
Created May 1, 2012 06:55
PERSISTENT LOCALSTORAGE NATIVE SOLUTION for phonegap (fork of http://pastebin.com/5881768B)
/*
*
* PERSISTENT LOCALSTORAGE NATIVE SOLUTION for phonegap (tested on 1.3)
* iOS 5.1 puts LocalStorage in a vulnerable location (Libary/Caches). This will copy it to
* the documents folder as "appdata.db" so that it will be appropriately backed-up and not
* overwritten. If "appdata.db" doesn't exist, localStorage will not be overwritten.
* Also, upon application suspend (resignActive) or termination, localStorage is saved, so
* there should not be any chance that changes to localStorage won't be persisted. [[ short of a power-cycle ]]
*
* The following should be placed in AppDelegate.m. Note that it //partially// replaces
@walm
walm / MainViewController.m
Created September 20, 2012 05:52
Remove UIWebVew keyboard toolbar
// Put code in MainViewController.m if using PhoneGap,
// else but it in ViewController controlling UIWebView
// Register for keyboard show event
// Some where in a init ex initWithNibName
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
@walm
walm / image_filters.rb
Created October 3, 2012 05:03 — forked from tonycoco/image_filters.rb
Useful image filters (Instagram/Hipster/Cool) for CarrierWave using MiniMagick (ImageMagick)
module CarrierWave
module MiniMagick
def toaster_filter
manipulate! do |img|
img.modulate '150,80,100'
img.gamma 1.1
img.contrast
img.contrast
img.contrast
img.contrast
@walm
walm / testflight.sh
Created November 1, 2012 21:09 — forked from azu/testflight.sh
xcode build & upload testflight from coomand line
#!/bin/sh
######CONFIG#####
# TestFlight API Token
# from https://testflightapp.com/dashboard/team/edit/
# $ git config --global testflight.apitoken XXX
# form https://testflightapp.com/account/#api
# $ git config --global testflight.teamtoken XXX
# Testflight API token
API_TOKEN=$(git config testflight.apitoken)
@walm
walm / sliceit.scpt
Created November 18, 2012 12:33
Run Slicy on PSD from command line using AppleScript
on run argv
set input_file to POSIX file (item 1 of argv)
set output_path to item 2 of argv
-- TODO: add some error handling :)
-- make sure output folder exists
do shell script "mkdir -p " & output_path
-- drop input file on Slicy app
@walm
walm / script.js
Created February 8, 2013 11:43
Ort utifrån postnummer via Posten med jQuery
$.get('http://www.posten.se/soktjanst/postnummersok/resultat.jspv?pnr=11240', function(data){
console.log("Ort", $(data).find('td.lastcol').first().text());
});
@walm
walm / setup-ubuntu-server.sh
Last active December 18, 2015 01:49
Ubuntu 12.10 base setup
SERVER=127.0.0.1
USER=deployer
PASSWORD=superpass
ssh $SERVER
# add deployer user
groupadd admin
useradd $USER -m -s /bin/bash -G admin
echo $USER:$PASSWORD | chpasswd
@walm
walm / sshd-supervisord.conf
Created October 7, 2013 09:52
sshd-supervisord.conf for Docker images
[supervisord]
nodaemon=true
[program:sshd]
command=/usr/sbin/sshd -D
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true