Skip to content

Instantly share code, notes, and snippets.

View gazay's full-sized avatar
🌐

Alex Gaziev gazay

🌐
View GitHub Profile

jitter.sh

For making your own jittergrams

Usage

Two files as input:

./jitter.sh file_01.jpg file_02.jpg
# eval with method definition is used to prevent warnings in some situations
DEFINEE = <<-CODE
eval 'def __; end'
it = method(:__).owner rescue instance_method(:__).owner
eval 'undef __'
it
CODE
self # => main
@barbuza
barbuza / microdns.py
Created May 20, 2012 16:21
fake python dns server for use with mac /etc/resolver system
# -*- coding: utf-8 -*-
import re
import socket
class UnsupportedQuery(BaseException):
pass
module A
# prefer when there are less than three class methods
# and there are instance methods
def self.boo
end
def self.soo
end
def fuuu
guard :rake, task: 'test', notification: false do
watch(/^(src|spec)\/(.+)\.coffee$/)
end
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active October 2, 2026 07:01
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@joho
joho / gist:3735740
Created September 17, 2012 05:40 — forked from rafaelss/gist:3700977
PostgreSQL 9.2 upgrade steps
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. brew update
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
@brainopia
brainopia / openssl.sh
Created October 2, 2012 06:55
Fix readline/openssl extension
cd $rvm_path/src/${MY_RUBY_HOME##*/}/ext/openssl
rvm pkg install openssl
ruby extconf.rb -- --with-openssl-dir="$rvm_path/usr"
make install
cd $rvm_path/usr/ssl
curl http://curl.haxx.se/ca/cacert.pem > cert.pem
@rwjblue
rwjblue / readme.md
Last active May 13, 2016 18:10
Guide to using drip with JRuby

#Overview drip is an awesome command line tool that can be used to dramatically lower perceived JVM startup time. It does this by preloading an entirely new JVM process\instance and allowing you to simply use the preloaded environment. This has extraordinary results with jruby.

We reduced time to run rake environment from 13 seconds to a mere 3.5 seconds. This is actually at or near MRI 1.9.3p327 (with falcon patch) speeds!

Adding a few addition jruby options will reduce startup time even further (down to 1.69 seconds).

#Install Drip Install drip if you haven't already (see https://github.com/flatland/drip)

@kidpixo
kidpixo / jupyter_shortcuts.md
Last active February 24, 2026 15:43
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Warning This is SEVERELY outdated, the current jupyter version is > 6.X, please refer to your current jupyter notebook installation!

Disclaimer : I just copied those shortcuts from Jupyter Menú > Help > Keyboard Shortcuts, I didn't wrote them myself.

Check your current shortcuts in your Help, shortcuts coule have been modified by extensions or your past self.

Toc

Keyboard shortcuts