Skip to content

Instantly share code, notes, and snippets.

@pietia
pietia / gist:9661620
Created March 20, 2014 11:15
kill karma and gulp
kk() {
kill -9 $(ps aux | awk '/[k]arma/ {print $2}')
kill -9 $(ps aux | awk '/[g]ulp/ {print $2}')
}
var
styleSheets = document.styleSheets,
totalStyleSheets = styleSheets.length;
for (var j = 0; j < totalStyleSheets; j++){
var
styleSheet = styleSheets[j],
rules = styleSheet.cssRules,
totalRulesInStylesheet = rules.length,
totalSelectorsInStylesheet = 0;
@pietia
pietia / gist:5144689
Created March 12, 2013 16:56
deleted system ruby? no problem ...
pietia@a /System/Library/Frameworks/Ruby.framework $ tree .
.
├── Headers -> /Users/pietia/.rbenv/sources/1.8.7-p371/ruby-1.8.7-p371
└── Versions
└── 1.8
└── usr -> /Users/pietia/.rbenv/versions/1.8.7-p371
@pietia
pietia / gist:5141937
Last active December 14, 2015 20:09
OSX keeps track of your downloads. Add this to ie. ~/.zshrc
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent'
@pietia
pietia / gist:3999756
Created November 2, 2012 09:30
win test
xp + ie6
http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_XP_IE6.exe
vista + ie7
http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_Vista_IE7.part01.exe
http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_Vista_IE7.part02.rar
http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_Vista_IE7.part04.rar
http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_Vista_IE7.part05.rar
http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_Vista_IE7.part06.rar
asdasd
jQuery.fn.preventDoubleSubmit = function () {
var alreadySubmitted = false;
return jQuery(this).submit(function () {
if (alreadySubmitted)
return false;
else
alreadySubmitted = true;
});
};
@pietia
pietia / application_controller.rb
Created May 24, 2012 09:19 — forked from crosebrugh/application_controller.rb
Rails Admin config and runtime management
# add this to your ../app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
before_filter { |c| _admin_prolog(c) } # should be the first one!
after_filter { |c| _admin_epilog(c) } # should be the last one!
@pietia
pietia / config.ru
Created March 1, 2012 22:44
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
# We are not loading Active Record, nor the Assets Pipeline, etc.
# This could also be in your Gemfile.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
require "rails"
# Recommended editor under Windows: http://www.sublimetext.com
en:
mailers:
stage_of_change:
title:
title_1: "title 1"
title_2: "title 2"
body:
body_1: "body 1"
body_2: "body 2"