Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sqrel on github.
  • I am sqrel (https://keybase.io/sqrel) on keybase.
  • I have a public key ASA-_I7aSD9HhDmV-WE_76jeEx0OiGPhBiEjYvIA6FmZVQo

To claim this, I am signing this object:

@SqREL
SqREL / em.rb
Created March 16, 2017 10:52
flashapi
require_relative
'../flashapi/lib/flashapi'
require 'eventmachine'
## APPLICATION
module Application
module Routes
extend self
@SqREL
SqREL / es.rb
Created October 20, 2016 23:12
Simple kind of event sourcing
class StateObject
def initialize
@name = nil
@surname = nil
@email = nil
end
def update_name(name)
@name = name
Events::UpdateName.new(name).push
@SqREL
SqREL / gist:13df76f66f4d248199bd
Created November 22, 2015 18:05
iOS package sniffer
1.Connect your iOS device to your Mac via USB.
2.Get the UDID for the connected device from iTunes or organiser.
3.Open terminal in your Mac
4.type the following commands in the terminal
$ ifconfig -l // First get the current list of interfaces.
$ rvictl -s <udid> // Then run the tool with the UDID of the device.
@SqREL
SqREL / postgres_drop_connections
Last active August 29, 2015 14:17 — forked from tokenvolt/postgres_drop_connections
Drop postgres connections
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'TARGET_DB' AND pid <> pg_backend_pid();
@SqREL
SqREL / greenlantern.zsh-theme
Last active October 12, 2015 09:38
Oh-my-zsh theme with git support (shows current branch, changed status and time from last commit)
PROMPT='%{$fg[blue]%}%m%{$reset_color%}:%c $(git_time_since_commit)$(git_prompt_info)%# '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[magenta]%}git:"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}) "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}+%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
# Colors vary depending on time lapsed.