Skip to content

Instantly share code, notes, and snippets.

@chocnut
chocnut / config.fish
Created February 23, 2019 12:21 — forked from pierre-b/config.fish
golang fish shell config
# config file
# vim ~/.config/fish/config.fish
# reload the config
# source ~/.config/fish/config.fish
# set the workspace path
set -x GOPATH /users/my-username/go
# add the go bin path to be able to execute our programs
@chocnut
chocnut / .vimrc
Created December 19, 2018 01:56
VIM 30 days challenge
" Plugins install VIM plug
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-commentary'
Plug 'altercation/vim-colors-solarized'
Plug 'bling/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'airblade/vim-gitgutter'
Plug 'godlygeek/tabular'
Plug 'vim-ruby/vim-ruby'
@chocnut
chocnut / Gemfile
Last active December 11, 2016 19:49
iOS AC + Social(Facebook) Framework & Rails(omniauth-facebook)
gem 'devise'
gem 'omniauth-facebook'
#!/bin/bash
#
# Bash script for Subversion integration with Slack
#
# 1. Save this file in /usr/bin as slack-svn
# 2. Make it executable:
# chmod +x /usr/bin/slack-svn
# 3. Put this line at the end of file of your_svn_repo/hooks/post-commit:
# slack-svn $REPOS $REV full_path_to_svn_directory
# 4. Edit this file, especially from line 16-20 and 27 (example given is for Redmine)
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8'
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';
#!/bin/bash
echo "Pls enter your user name:"
read name
echo "export CC_API_LOGIN=$name" >> ~/.bashrc
echo "Please enter your License Key:"
read key
echo "export CC_API_KEY=$key" >> ~/.bashrc
echo "Done."
class Api::V1::AdvisorUserEntriesController < Api::V1::BaseController
respond_to :json
def show
result = {
:user => @advisor_user_entry,
:advisor_user_entry => @advisor_user_entry ,
:meta => { :message => "Returned an existing User." }
}
@chocnut
chocnut / trace
Created February 27, 2014 17:47
httparty
NoMethodError in Api::V1::ProxyController#execute
undefined method `strip' for #<StringIO:0x007fa046151330>
Rails.root: /Users/peterindiola/Projects/geekhq/crystal_commerce/RoadHouse
Application Trace | Framework Trace | Full Trace
/Users/peterindiola/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/net/http.rb:1436:in `block in initialize_http_header'
/Users/peterindiola/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/net/http.rb:1434:in `each'
/Users/peterindiola/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/net/http.rb:1434:in `initialize_http_header'
httparty (0.13.0) lib/httparty/request.rb:151:in `setup_raw_request'
<?php
class GridFieldSelectColumn implements GridField_ColumnProvider {
public function __construct($useToggle = true, $targetFragment = 'before') {
$this->targetFragment = $targetFragment;
$this->useToggle = $useToggle;
}
public function augmentColumns($field, &$cols) {
if(!in_array('Select', $cols)) $cols[] = 'Select';
}
gem 'pg'
group :development do
gem 'ruby-debug'
end
gem 'rake', '~> 0.8.7'
gem 'devise'
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'omniauth'
gem 'haml'
gem 'dynamic_form'