Skip to content

Instantly share code, notes, and snippets.

work work work

Alexii Carey elchingon

work work work
View GitHub Profile
View cancan.rb
# Hack to get strong_parameters working
class CanCan::ControllerResource
# Before using @params[whatever], CanCan will try calling whatever_params
def resource_params_by_namespaced_name
rescue NoMethodError
View gist:b189583400fa60b5ef9e
i =0
while read p; do
let "i += 1"
if [[ $p == *"git"* ]]
if [[ $p != *"master.git"* && $p != *"fabi-ios"* ]]
echo "cloning $p"
git clone $p
View angular.filters.nl2br.js
# Usage in html template:
"xxx | nl2br"
<div ng-bind-html=" YourString | nl2br "></div>
elchingon / Ubuntu Unicorn RVM Init.d script
Last active Aug 29, 2015
Ubuntu Unicorn RVM Init.d script
View Ubuntu Unicorn RVM Init.d script
---- find out the version of ruby and your gemset (because rvm rules)
rvm current
--- create rvm alias
rvm alias create app_name ruby-2.1.2@app_gemset
--- set rvm wrappers (they removed no-link option and seems like all core gems are given a wrapper)
rvm wrapper app_name unicorn_rails
--- /etc/init.d/unicorn
View bash_profile_tab_naming
function tabname {
# Will use current dir name if called without arg.
printf "\e]1;${1-$(basename `pwd`)}\a"
function winname {
# Will use current dir name if called without arg.
printf "\e]2;${1-$(basename `pwd`)}\a"
function tab {
# Will cd into current dir if called without arg.
elchingon / gitconfig
Created Dec 10, 2013
My gitconfig defaults
View gitconfig
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
elchingon / gist:520399baf62792e7df69
Last active Feb 4, 2016
ISP Watchdog python script for Raspberry Pi
View gist:520399baf62792e7df69
# you need to install dependent programs and utilities such as speedtest-cli, a command line interface program that tests your bandwidth speeds via
import os
import sys
import csv
import datetime
import time
import twitter
def test():
elchingon / customers.sql
Created Aug 25, 2016 — forked from leek/
Magento - Delete All Test Data
View customers.sql
-- Customers
TRUNCATE `customer_address_entity`;
TRUNCATE `customer_address_entity_datetime`;
TRUNCATE `customer_address_entity_decimal`;
TRUNCATE `customer_address_entity_int`;
TRUNCATE `customer_address_entity_text`;
TRUNCATE `customer_address_entity_varchar`;
TRUNCATE `customer_entity`;
elchingon / Ubuntu Unicorn rbenv
Created Jun 10, 2015
Ubuntu Unicorn rbenv init.d
View Ubuntu Unicorn rbenv
--- /etc/init.d/unicorn
# File: /etc/init.d/unicorn
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network $syslog
elchingon / sidekiq-init.d.txt
Last active Jan 11, 2017
Ubuntu Sidekiq Service Init.d script
View sidekiq-init.d.txt
--- /etc/init.d/sidekiq - SAVE File
# sidekiq Init script for Sidekiq
# chkconfig: 345 100 75
# Description: Starts and Stops Sidekiq message processor for Stratus application.
# User-specified exit parameters used in this script:
You can’t perform that action at this time.