Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View elchingon's full-sized avatar
🐵
coffee-free since Sept' 2023

Alexii Carey elchingon

🐵
coffee-free since Sept' 2023
  • E7 Systems / Ciego Productions
  • Colorado
View GitHub Profile
@elchingon
elchingon / customers.sql
Created August 25, 2016 02:14 — forked from leek/_Magento1_DeleteTestData.md
Magento - Delete All Test Data
SET FOREIGN_KEY_CHECKS=0;
-- 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`;
#!/bin/bash
# this needs to be run in crrent process with the "dot" command
# . create_vim.sh ims|opc
tabname=$1
printf "\e]1;${1-$(basename `pwd`)}\a"
case $tabname in
ims)
cd '/Users/xxxxxx/Sites/tayda/tayda_inventory'
;;
opc)
@elchingon
elchingon / gist:520399baf62792e7df69
Last active June 17, 2021 06:54
ISP Watchdog python script for Raspberry Pi
#!/usr/bin/python
# you need to install dependent programs and utilities such as speedtest-cli, a command line interface program that tests your bandwidth speeds via speedtest.net
import os
import sys
import csv
import datetime
import time
import twitter
def test():
@elchingon
elchingon / Ubuntu Unicorn rbenv
Created June 10, 2015 17:18
Ubuntu Unicorn rbenv init.d
--- /etc/init.d/unicorn
#!/bin/sh
# File: /etc/init.d/unicorn
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network $syslog
@elchingon
elchingon / bash_profile_tab_naming
Created May 3, 2015 15:45
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
elchingon / Ubuntu Unicorn RVM Init.d script
Last active August 29, 2015 14:20
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
/*
# Usage in html template:
"xxx | nl2br"
<div ng-bind-html=" YourString | nl2br "></div>
or:
@elchingon
elchingon / gist:b189583400fa60b5ef9e
Created February 27, 2015 00:02
Git bash scripts
#!/bin/bash
i =0
while read p; do
let "i += 1"
if [[ $p == *"git"* ]]
then
if [[ $p != *"master.git"* && $p != *"fabi-ios"* ]]
then
echo "cloning $p"
git clone $p
# Hack to get strong_parameters working
CanCan::ControllerResource
class CanCan::ControllerResource
protected
# Before using @params[whatever], CanCan will try calling whatever_params
def resource_params_by_namespaced_name
@controller.send(:"#{extract_key(namespaced_name)}_params")
rescue NoMethodError
@elchingon
elchingon / gitconfig
Created December 10, 2013 05:21
My gitconfig defaults
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold