Skip to content

Instantly share code, notes, and snippets.

View mxlje's full-sized avatar
🌩️

Max Lielje mxlje

🌩️
View GitHub Profile
@mxlje
mxlje / underscore.move.js
Last active August 26, 2015 17:53 — forked from kjantzer/underscore.move.js
Underscore.js Mixin: Move - takes array and moves item at index and moves to another index; great for use with jQuery.sortable()
/*
_.move - takes array and moves item at index and moves to another index; great for use with jQuery.sortable()
*/
_.mixin({
move: function (array, fromIndex, toIndex) {
array.splice(toIndex, 0, array.splice(fromIndex, 1)[0] );
return array;
}

Keybase proof

I hereby claim:

  • I am mxlje on github.
  • I am mxlje (https://keybase.io/mxlje) on keybase.
  • I have a public key whose fingerprint is 2ADF A1D9 FDC5 5C54 1DCE 1356 A039 EA57 86C1 43E2

To claim this, I am signing this object:

organizer = Organizer.create(
email: "a@b.com",
company_name: "Example Company",
password_digest: "$2a$10$qQQws7Kb2IG1qfqp4OgdZ.dtKicGew79HZkWUO0gzaerhkC6/3OuC"
)
Event.create(
name: "Awesome Event",
description: "Lorem Ipsum",
organizer: organizer,
<h1>The Document Outline in HTML - When to use a heading tag for a heading?</h1>
<p><strong> On a lot of websites, especially the ones with ready made templates, we see that the heading tags <code>&lt;h1&gt;</code> to <code>&lt;h6&gt;</code> are used incorrectly. This happens as the differention between style and markup is not considered in the right way. </strong></p>
<p>To make a nice looking website, you need only two files:</p>
<ol>
<li>an HTML Document for the structure</li>
<li>a CSS File for the styling</li>
</ol>
@mxlje
mxlje / outline.sass
Created May 5, 2014 06:32
The most important Sass Mixin.
@mixin outline($color: red)
outline: 1px solid $color
@mxlje
mxlje / config.vcl
Created June 9, 2014 10:26
varnish remove tracking cookies
if (req.http.Cookie) {
set req.http.Cookie = regsuball(req.http.Cookie, "(^|; ) *__utm.=[^;]+;? *", "\1"); # removes all cookies named __utm? (utma, utmb...) - tracking thing
if (req.http.Cookie == "") {
remove req.http.Cookie;
}
}
@mxlje
mxlje / id
Created August 2, 2014 15:49
Random ID TextExpander snippets
#!/usr/bin/env ruby
print `uuidgen`.downcase.split("-").take(2).join
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=47 time=145.805 ms
64 bytes from 8.8.8.8: icmp_seq=0 ttl=47 time=146.030 ms (DUP!)
64 bytes from 8.8.8.8: icmp_seq=1 ttl=47 time=84.042 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=47 time=84.503 ms (DUP!)
64 bytes from 8.8.8.8: icmp_seq=2 ttl=47 time=76.905 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=47 time=76.950 ms (DUP!)
64 bytes from 8.8.8.8: icmp_seq=3 ttl=47 time=105.836 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=47 time=105.844 ms (DUP!)
64 bytes from 8.8.8.8: icmp_seq=4 ttl=47 time=24.337 ms
@mxlje
mxlje / gist:3b8401d8fe8e2cc5c0fd
Created October 21, 2014 11:27
Poolside.fm Song URLs
2014-08-13
https://soundcloud.com/braxe1/3-voices
https://nextpreview.soundcloud.com/futureclassic/touch-sensitive-pizza-guy-3
https://soundcloud.com/foolsgoldrecs/grown-up-explicit
https://soundcloud.com/bondax/no-diggity
https://soundcloud.com/lordrecollectif/vanderway-early
https://soundcloud.com/electrocookie/metric-help-im-alive-the-twelves-remix
https://soundcloud.com/timsweeney/paradisbisrecords
https://soundcloud.com/itsindoorsoutdoors/cruiser-kidnap-me
[BUG] Segmentation fault at 0x00000000000000
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.