Skip to content

Instantly share code, notes, and snippets.

@bojanbjelic
bojanbjelic / .htaccess
Created April 20, 2012 21:31 — forked from necolas/.htaccess
Simple, quick way to concatenate, minify, and version static files in a Wordpress theme
# Filename-based cache busting
# taken from https://github.com/h5bp/html5-boilerplate/
# This rewrites file names of the form `name.123456.js` to `name.js`
# so that the browser doesn't use the cached version when you have
# updated (but not manually renamed) the file.
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
@jongalloway
jongalloway / CreateAdminUser.cs
Created August 23, 2012 06:11
I wanted to create an administrative user in an MVC 4 tutorial using a drop in code file (just throw in App_Start folder and it'll create the user on first run). Normally I'd use WebActivator for PostApplicationStart, but I wanted to make this just a simp
using Mvc4SampleApplication.Filters;
using System.Web;
using System.Web.Security;
using WebMatrix.WebData;
[assembly: PreApplicationStartMethod(typeof(PreApplicationTasks), "Initializer")]
public static class PreApplicationTasks
{
public static void Initializer()
@bojanbjelic
bojanbjelic / gist:3931503
Created October 22, 2012 13:27
jQuery ajax wait pattern
function getTwoThings( callback ) {
var peopleRequest = $.getJSON( '/data/people.json' );
var taskRequest = $.getJSON( '/data/tasks.json' );
$.when( peopleRequest, taskRequest )
.done(function( people, tasks ) {
callback( people[0].people, tasks[0].tasks );
});
}
@bojanbjelic
bojanbjelic / flushdns.sh
Created December 2, 2012 23:21
mac osx lion flush DNS cache
sudo killall -HUP mDNSResponder
int gap = 20;
void setup() {
size(1000, 1000);
strokeWeight(4);
strokeCap(SQUARE);
frameRate(0.5);
}
void draw() {
anonymous
anonymous / config.json
Created June 16, 2017 17:07
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "#000",
"@brand-success": "#cecece",
@hactar
hactar / wl.json
Last active October 18, 2017 21:55
Wiener Linien JSON version of the Wiener Linien - Real Time CSV Data (https://open.wien.at/site/datensatz/?id=add66f20-d033-4eee-b9a0-47019828e698) This file is generated using the WL Generator Tool (https://github.com/hactar/WL-Generator)
[
{
"stationID":"214460106",
"relatedLines":"6",
"latitude":"48.1737831466666",
"name":"Absberggasse",
"longitude":"16.3897519115987",
"platforms":[
{
"line":"6",
@johannesnagl
johannesnagl / Tweetsheets
Created August 9, 2012 10:25
Use Twitter directly in your Google Doc, so no one will ever blame you for being social
var CONSUMER_KEY = "<< YOUR KEY HERE >>";
var CONSUMER_SECRET = "<< YOUR SECRET HERE >>";
function getConsumerKey() {
return CONSUMER_KEY;
}
function getConsumerSecret() {
return CONSUMER_SECRET;
}
@bojanbjelic
bojanbjelic / rss-dl-mp3.sh
Created November 19, 2012 23:35
download mp3s from a rss feed
wget [RSS URL]
grep -e '[^"]*\.mp3' [downloaded RSS] | grep -o '[^"]*\.mp3' '-' >> list.txt
wget -i list.txt
@simX
simX / hidpi.txt
Created July 28, 2012 04:58
Enable HiDPI mode in Mountain Lion w/o Quartz Debug
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES;
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled;
// by the way, you need to logout and log back in for this to take effect. Or at least that's what
// Quartz Debug says. Who knows, maybe it's lying?
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from.