Skip to content

Instantly share code, notes, and snippets.

Avatar

Håkon Erichsen haeric

View GitHub Profile
View gist:61a631b2c90d84be783c
### Keybase proof
I hereby claim:
* I am haeric on github.
* I am haeric (https://keybase.io/haeric) on keybase.
* I have a public key whose fingerprint is 4C6F 3F98 159C EABC C246 AE71 DCF8 E36D DA57 CB36
To claim this, I am signing this object:
View gist:7249c75fd0d91c725d46
function MyLittlePony(arg1, arg2, arg3) {
if (this === window) return new MyLittlePony(arg1, arg2, arg3);
...
}
View gist:5d1e273b4ee1aa84776d
if ( updateBuffers ) {
setupVertexAttributes( material, programAttributes, geometryAttributes, startIndex );
_gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, index.buffer );
}
// render indexed triangles
_gl.drawElements( _gl.TRIANGLES, offsets[ i ].count, type, offsets[ i ].start * size );
View gist:9800290
<ul id="treeview-collapse">
<li><span class="icon icon-folder2"></span>
<p>level 1</p>
<ul>
<li>level 2
<ul>
<li>level 3</li>
<li>level 3
<ul>
<li>level 4</li>
@haeric
haeric / gist:8432080
Created January 15, 2014 07:07
NSF Research awards py parser
View gist:8432080
data = """
Title : CAREER: Markov Chain Monte Carlo Methods
Type: Award
NSF Org : CCR
Latest
Amendment
Date : May 5, 2003
File : a0237834
Award Number: 0237834
View gist:7248868
function LolCat () {
// Private variabler og metoder
var foods = ['cheezburgerz', 'icecriim', 'your dinner'];
function likes (food) {
return foods.indexOf(food) !== -1;
}
// Såkalte priviliged variabler og metoder: De har tilgang til private variabler, men kan brukes utenfra
View gist:7248568
function UnfortunateKitty (name) {
// Private variabler og funksjoner, bare tilgjengelig i dette scopet
var numberOfLives = 9;
function die () {
console.log("Honey, the cat died :(");
}
// Public variabler og metoder, som har tilgang til til de private variablene
@haeric
haeric / gist:6430547
Last active December 22, 2015 06:19
annotated_self = Showing.objects.filter(pk=8).annotate( num=Sum('billig_showing__ticket_groups__num'), num_sold=Sum('billig_showing__ticket_groups__num_sold') )
View gist:6430547
SELECT "event_showing"."id", "event_showing"."event_id", "event_showing"."billig_showing_id",
"event_showing"."uka_showing_id", "event_showing"."publish_time", "event_showing"."place",
"event_showing"."free", "event_showing"."canceled", "event_showing"."entrance_id",
SUM("billig_ticket_group"."num") AS "num",
SUM("billig_ticket_group"."num_sold") AS "num_sold"
FROM "event_showing"
LEFT OUTER JOIN "billig_event" ON ("event_showing"."billig_showing_id" = "billig_event"."event")
LEFT OUTER JOIN "event_ukashowing" ON ("event_showing"."uka_showing_id" = "event_ukashowing"."id")
LEFT OUTER JOIN "billig_ticket_group" ON ("billig_event"."event" = "billig_ticket_group"."event")
WHERE "event_showing"."id" = 8
View gist:5648955
for ( var xi = 0; xi < size; xi++ )
for ( var yi = 0; yi < size; yi++ )
for ( var zi = 0; zi < size; zi++ ) {
...
}
View gist:5607803
function animate() {
requestAnimationFrame( animate );
delta = Math.min( 1.0, clock.getDelta() );
if ( settings.paused )
return;
world.update( delta );