Skip to content

Instantly share code, notes, and snippets.

View eigan's full-sized avatar

Einar Gangsø eigan

  • Spinner Labs
  • Norway
View GitHub Profile
@eigan
eigan / Compare-web-pages.md
Last active September 21, 2021 11:45
Compare two webpages

Comparing two webpages

Requirements

Installation

Mac OSX

curl -O https://gist.githubusercontent.com/eigan/a2f418371925afe62226/raw/webdiff.sh
@eigan
eigan / gist:6593476
Last active December 23, 2015 06:19

Method for checking viewport in javascript

Really simple trick to get the current viewport in javascript.

HTML (somewhere in your grid)

<div class="viewport-width-id"></div>
@eigan
eigan / gist:4998018
Created February 20, 2013 18:50
Need this to get regions button in sc2 wings of liberty after 2.0.4 patch
<regions>
<region displayname="AUTHENTICATION_SG_REGION" hostname="sg"
allowedProductLocales="all" localesThatDefaultToThisRegion="enSG"/>
<region displayname="AUTHENTICATION_US_REGION" hostname="us"
allowedProductLocales="all" localesThatDefaultToThisRegion="enUS"/>
<region displayname="AUTHENTICATION_EU_REGION" hostname="eu"
allowedProductLocales="all" localesThatDefaultToThisRegion="enGB"/>
<region displayname="AUTHENTICATION_KR_REGION" hostname="kr"
allowedProductLocales="all" localesThatDefaultToThisRegion="koKR"/>
</regions>
@eigan
eigan / primes.php
Created December 31, 2010 01:31
70B
2
3<?for(;$n++<542;print$y?"
$n":'')for($i=2;$i<=$n/2&&$y=$n%$i++>0;);
@eigan
eigan / fib.php
Created December 30, 2010 14:12
47B fibonacci
0<?$b++;while(($b+=$a=$b-$a)<2178309)echo"
$a";
@eigan
eigan / itunes_xml_parser.php
Created August 6, 2010 17:09
Itunes php xml parser class
<?php
/**
* Need to get an array of either tracks or playlists from your itunes library?
* yes? then use this shitty code then
*
* Just do like this:
*
* $itunes = new Parse("path/to/your/iTunes Music Library.xml", "all");
*
* The first paramter is (obviously) the xml file