Skip to content

Instantly share code, notes, and snippets.

View erkie's full-sized avatar
🕺
working

Erik Rothoff Andersson erkie

🕺
working
View GitHub Profile
@erkie
erkie / PhotoGrabber.h
Created June 21, 2011 18:10
Capture photos from built in iSight-camera or other connected cameras using Objective-C
//
// PhotoGrabber.h
// By Erik Rothoff Andersson <erikrothoff.com>
//
#import <Foundation/Foundation.h>
#import <QTKit/QTKit.h>
@protocol PhotoGrabberDelegate <NSObject>
@erkie
erkie / UsePhotoGrabber.m
Created June 21, 2011 18:27
Using PhotoGrabber
// How to use the Gist from https://gist.github.com/1038480
// By Erik Rothoff Andersson <erikrothoff.com>
#import "PhotoGrabber.h"
@implementation MyClass
- (void)doSomething
{
PhotoGrabber *grabber = [[PhotoGrabber alloc] init];
@erkie
erkie / UIFont+DahDit
Last active November 27, 2021 22:45
UILabel get CGRect for substring of text
//
// UIFont+DahDit.m
// DahDit
//
// Created by Erik Andersson on 2011-07-28.
// Copyright 2011 Åva gymnasium. All rights reserved.
//
#import "UIFont+DahDit.h"
@erkie
erkie / background.html
Created May 19, 2012 09:43
Save parts of screen using Chrome extension
<script>
var Constants = {
saveURL: 'http://random/birthday/saveimage.php',
w: 500,
h: 500,
x: 200,
y: 200
};
grep " " -Ri * | grep .less
@erkie
erkie / foo.html
Last active December 22, 2015 14:48
supersimplegallery
<script>
$('.carousel').each(function() {
var gallery = $(this);
var list = $(this).find(".gallery");
list.find('li:first').addClass('active');
list.find('li:not(:first)').addClass('startright');
var indicators = $(this).find(".indicators");
var startTime = 0;
@erkie
erkie / README.md
Last active October 20, 2016 08:36
Convert less to sass

Convert .less files to .scss

To run:

cd root-directory-of-project/
ruby less-to-sass.rb

# or
ruby less-to-sass.rb <file-glob-to-convert>
@erkie
erkie / hacking.b64
Last active August 29, 2015 14:09
hackers
V2Ugc3RhcnRlZCBpWmV0dGxlIHdpdGggYSBzaW5nbGUgbWlzc2lvbjogVG8gbGF1bmNoIGEgYnJpbGxpYW50IGxpdHRsZSBwcm9kdWN0IHRoYXQgd291bGQgaGVscCBzbWFsbCBidXNpbmVzc2VzIGFuZCBlbnRyZXByZW5ldXJzIGFyb3VuZCB0aGUgd29ybGQgbmV2ZXIgbWlzcyBvdXQgb24gc2FsZXMgYWdhaW4uIEJ1dCBhY2hpZXZpbmcgdGhhdCBnb2FsIHJlcXVpcmVzIG1vcmUgYW1hemluZyBwZW9wbGUuIFdlIHdhbnQgb25seSB0aGUgYmVzdCBhbmQgYnJpZ2h0ZXN0IOKAkyByYXJlIGluZGl2aWR1YWxzIHdobyBhcmUgaW4gZmFjdCBpbmRpdmlkdWFsczsgZnVuLWxvdmVycyB3aG8gaGF2ZSBhIGtlZW4gYXBwcmVjaWF0aW9uIGFuZCBzaXh0aCBzZW5zZSBmb3IgcGl4ZWwtcGVyZmVjdCBkZXNpZ24sIGVsZWdhbnQgZW5naW5lZXJpbmcsIG9yIHRha2UtdGhlLXdvcmxkLWJ5LXN0b3JtIG1hcmtldGluZyBhbmQgc2FsZXMuIElmIHRoYXTigJlzIHlvdSwgcGxlYXNlIGdldCBpbiB0b3VjaCEgDQoNCldlIGxvb2sgZm9yd2FyZCB0byB3ZWxjb21pbmcgeW91IG9uYm9hcmQgdGhlIGlaZXR0bGUgdGVhbS4NCldoYXQgdG8gZXhwZWN0Pw0KDQpHcmVhdCBsb2NhdGlvbiwgaW50ZXJuYXRpb25hbCBlbnZpcm9ubWVudC4gT3VyIG5hdGl2ZSBTdG9ja2hvbG0gaXMgd29ybGQgY2xhc3MgaW4gYmVhdXR5LCBkZXNpZ24gYW5kIG11Y2ggbW9yZS4gU28gbm8gd29uZGVyIHdlIGxvdmUgaXQsIGJ1dCB3ZSBhbHNvIGxvdmUgdGhlIHdvcmxkLiBBbmQgdGhhdCdzIHdo
@erkie
erkie / thatsa.rb
Created January 19, 2015 12:12
code joke
v = 1
v <=8
# true
import Ember from 'ember';
export default Ember.Component.extend({
inputObj: Ember.computed(function() {
var self = this;
return {
latitude : '12.976299881670053',
longitude : '80.13112306594849',
zoom : 7,