This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
# Usage in html template: | |
"xxx | nl2br" | |
<div ng-bind-html=" YourString | nl2br "></div> | |
or: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold | |
frag = magenta bold | |
old = red bold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /etc/init.d/unicorn | |
#!/bin/sh | |
# File: /etc/init.d/unicorn | |
### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $local_fs $remote_fs $network $syslog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /etc/init.d/sidekiq - SAVE File | |
#!/bin/bash | |
# 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adding Events to Site | |
--------------------- | |
There are 4 different viewTypes that pass events or coupons based on adId or organizationId. | |
{ viewType: eventsForAd, adId: 360APIAdId, limit: LIMIT} -- limit is optional | |
{ viewType: couponsForAd, adId: 360APIAdId } | |
{ viewType: couponsSmallForAd, adId: 360APIAdId } | |
{ viewType: eventsForOrganization, organizationId: 360DurangoAPIOrganizationId } | |
{ viewType: adsForOrganization, organizationId: 360DurangoAPIOrganizationId } |
OlderNewer