Skip to content

Instantly share code, notes, and snippets.

View jtomaszewski's full-sized avatar

Jacek Tomaszewski jtomaszewski

View GitHub Profile
git clone https://github.com/adblockplus/adblockpluschrome
cd adblockpluschrome
git clone https://github.com/adblockplus/adblockplus
git clone https://github.com/adblockplus/buildtools
git clone https://github.com/adblockplus/adblockplustests
cd buildtools
git clone https://github.com/adblockplus/jshydra
cd ..
# Build Chrome development environment (you can use either "chrome", "opera" or "safari")
@maxim
maxim / spec_helper.rb
Created June 9, 2012 18:14
Making after_commit play nice with use_transactional_fixtures.
# This is an example of how to use database_cleaner gem and
# RSpec tags to make `after_commit` hook play nice with
# `use_transactional_fixtures`.
# Simply mark the specs that use after_commit with
# `:uses_after_commit` tag.
# ...
require 'database_cleaner'
@slindberg
slindberg / convert_charset
Created September 26, 2012 19:42
Bash script for converting the charset of all tables in a database
#!/bin/bash
# Convert all tables in a specified database to a different charset
#
# NOTE: this will NOT preserve data if it was stored improperly to begin with,
# e.g. UTF8 encoded strings saved as latin1 charset will get munged by this
# script when the table is converted. To preserve data you must export it, change
# the charset, then re-import.
#
# Command taken from:
@jedahu
jedahu / es5_ng_it.js
Last active December 13, 2015 20:58
Replacement async 'it' for testing AngularJs with Mocha.
function ngIt($injector) {
return function(text, fn) {
it(text, function(done) {
var $rootScope = $injector.get('$rootScope')
, fin
, finished = function(err) {
fin = true;
done(err);
};
fn(finished);
@mythril
mythril / weinred.sh
Last active December 18, 2015 10:39
weinre init.d script
#!/bin/bash
### BEGIN INIT INFO
# Provides: weinre
# Required-Start: $remote_fs $syslog networking
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: weinre mobile debugger
# Description: Provides remote front-end debugger for mobile user agents
# like Chrome Inspector or FireBug
@ahmeij
ahmeij / open-id-square.svg
Last active January 4, 2016 08:59
yahoo, yahoo-square, outlook, outlook-square, open-id, open-id-square svg's for use with fontcustom
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@robertjwhitney
robertjwhitney / activeadmin_sortable.js.coffee
Created July 3, 2012 03:37
Simple drag/drop reordering of records in an ActiveAdmin view table
# http://stackoverflow.com/a/8936202
#
# ActiveAdmin already includes the necessary jquery in active_admin/base,
# so just add this to javascripts/active_admin.js after //= require active_admin/base
#
#
# Serialize and Sort
#
# model_name - you guessed it, the name of the model we are calling sort on.
# This is the actual variable name, no need to change it.
@nragaz
nragaz / unicorn.rb
Created July 12, 2010 03:34
unicorn.rb
# unicorn_rails -c /srv/myapp/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
working_directory (rails_env == 'production' ? "/srv/myapp/current" : `pwd`.gsub("\n", ""))
worker_processes (rails_env == 'production' ? 10 : 4)
preload_app true
timeout 30
if rails_env == 'production'
@jasoncodes
jasoncodes / _form.html.haml
Created October 18, 2011 05:42
Using ActiveRecord optimistic locking with Inherited Resources
/ ...
- f.inputs do
= f.hidden_field :lock_version
/ ...
@mardr
mardr / mbank_unlifting.user.js
Last active April 15, 2019 18:25
Przywraca wygląd strony transakcyjnej mbanku z przed liftingu. Do działania wymaga jednego z rozszerzeń do przeglądarki: np. Greasemonkey lub Tampermonkey.
// ==UserScript==
// @name mbank unlifting
// @description Przywraca wygląd strony transakcyjnej mbanku z przed liftingu
// @version 0.1
// @grant none
// @author mardr
// @include https://online.mbank.pl/*
// ==/UserScript==
document.documentElement.classList.remove('lifting');