Skip to content

Instantly share code, notes, and snippets.

View liquid1982's full-sized avatar

Vincenzo Acinapura liquid1982

  • TrustLayer, Inc.
  • Miami, FL
View GitHub Profile
@liquid1982
liquid1982 / reverse-tunnel.sh
Created March 23, 2009 09:07
Reverse tunnel SSH
ssh -v -p 22 -nNT4 -R *:<public-port>:localhost:<local-port> <public-host-username>@<public-host>
ssh -v -nNT4 -R *:3000:localhost:3000 user@www.host.com
@liquid1982
liquid1982 / change-wp-domain
Created December 1, 2010 08:57
Query used to update the domain while moving a wordpress installation to a new domain.
SET @old = 'http://old'; # Vecchio dominio - da cui si trasferisce l'installazione
SET @new = 'http://new'; # Nuovo dominio - verso cui si trasferisce l'installazione
UPDATE wp_options SET option_value = replace(option_value, @old, @new) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, @old, @new);
UPDATE wp_posts SET post_content = replace(post_content, @old, @new);
# Example code and benchmark harness for http://blog.gregspurrier.com/articles/arbitrary-reordering-of-ruby-arrays
require 'rubygems'
require 'rspec'
module Enumerable
def reorder_by1(order, &key_proc)
order.map do |x|
find {|obj| key_proc.call(obj) == x}
end
include Tire::Model::Search
include Tire::Model::Callbacks
settings :analysis => {
:filter => {
:ngram_filter => {
:type => 'edgeNGram',
:min_gram => 1,
:max_gram => 10,
:side => 'front'
#! /bin/bash
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the unicorn web server
# Description: starts unicorn
#!/sbin/runscript
# GitLab init script for Gentoo Linux
# see https://github.com/gitlabhq/gitlabhq/blob/master/doc/installation.md
GITLAB_BASE=/home/gitlab/gitlab
GITLAB_USER=gitlab
depend() {
need net mysql redis
}
@liquid1982
liquid1982 / Gemfile
Created September 30, 2013 06:42 — forked from zernel/Gemfile
gem 'devise'
gem 'omniauth'
gem 'omniauth-github'
gem "omniauth-twitter"
gem "omniauth-facebook"
gem "omniauth-google-oauth2"
@liquid1982
liquid1982 / listingDetail.js
Created January 31, 2014 12:58
gromia-payload.js
var gr = gr || {};
gr.listingDetail = {
// (string) `id`
"id": "526c4ff4d9464da9f800ff7f",
// (string) `category` - "residential"
"category": "residential",
// (string) `grouping` - "entirely" | "rooms"

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@liquid1982
liquid1982 / get
Created June 24, 2015 12:43
jsonapi example
curl -X GET http://localhost:3100/v2/job_positions/1?include=author,company,hiring_team_members&fields[company]=name&fields[author]=name&fields[hiring_team_members]=name,permissions