Skip to content

Instantly share code, notes, and snippets.

View marcinlawnik's full-sized avatar

Marcin Ławniczak marcinlawnik

View GitHub Profile
@marcinlawnik
marcinlawnik / gist:940641
Created April 25, 2011 15:07
fading out animation delayed
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script type="text/javascript">
$('#myDiv').delay(800).fadeOut(1000);
</script>
<div id="myDiv">
some text here
</div>
$('#my_id').delay(2000).fadeOut(2000);
<div id="my_id">
</div>
@marcinlawnik
marcinlawnik / gist:7324695
Created November 5, 2013 19:27
list of video game soundtracks from reddit to download
http://youtu.be/mODIsvf9Huc
http://youtu.be/GBpzVD4GZ8E
http://youtu.be/uH1wfrOcvHg
http://youtu.be/aFeL7kTw2CU
http://youtu.be/Lsj0mY13t9s
http://youtu.be/RJ3yIZ3_cxk
http://youtu.be/ROKcr2OTgws
http://youtu.be/xSfD4ClDBCk
http://youtu.be/ypNgvc6c6Cc
http://youtu.be/vGjwXI0n5-I
@marcinlawnik
marcinlawnik / gist:7327249
Created November 5, 2013 22:11
A simple script to download audio from yt and upload to gdrive, requires rg3/youtube-dl and gdrive
#!/bin/bash
youtube-dl -i -x -a list.txt
for file in *.m4a; do gdrive upload --file "$file"; done
find . -type f | wc -l
@marcinlawnik
marcinlawnik / gist:9583010
Created March 16, 2014 13:13
Scraping the darwin awards page
curl 'http://darwinawards.com/darwin/darwin[1993-2013].html' -o '#1.html'
cat *.html | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 | sort | uniq | grep -o -E '^.*darwin.*$' | grep -v '/' | grep '-'
rm *.html
#!/bin/sh
while read line
do
echo "http://darwinawards.com/darwin/$line">>url2.txt
done < url.txt
/****************
* drones101.js *
****************
*
* Do you remember, my dear Professor, a certain introductory
* computational rationality class you taught long ago? Assignment
* #2, behavior functions of autonomous agents? I remember that one
* fondly - but attack drones are so much easier to reason about
* when they're not staring you in the face, I would imagine!
//Simple maintenance filter for prefixes
//How to make it work for specific routes
// app/routes.php
/*
|--------------------------------------------------------------------------
| Maintenance per-route Filter
|--------------------------------------------------------------------------
@marcinlawnik
marcinlawnik / gist:91b33d48fb56f55477a1
Created July 30, 2014 21:16
Laravel route active
New (n)Fork (f)Raw (r)Copy URL (cmd+c)
Please note that all pasted data is publicly available.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{{ $title }}}</title>
//less code
.mw-echo-icon-cog {
/* @embed */
background-image: url(../icons/SettingsSmall.png) no-repeat 20px 15px !important;
background-image: -webkit-linear-gradient(transparent, transparent), e('/* @embed */') url(../icons/Settings.svg) no-repeat 20px 15px !important;
background-image: linear-gradient(transparent, transparent), e('/* @embed */') url(../icons/Settings.svg) no-repeat 20px 15px !important;
}
//generated invalid css
// in firefox its empty
#!/usr/bin/env python
# based on http://stackoverflow.com/questions/7052947/split-95mb-json-array-into-smaller-chunks
# usage: python json-split filename.json
# produces multiple filename_0.json of 1.49 MB size
import json
import sys
with open(sys.argv[1],'r') as infile:
o = json.load(infile)