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
# install using the line below in your terminal | |
# wget --no-check-certificate https://gist.githubusercontent.com/mankind/3926ea58d2172c260f21/raw/0b426c12c04f75dc78e51e0b556421070801ddae/rails_nodejs_install.sh && bash rails_nodejs_install.sh | |
echo "=======================================" | |
echo "========= updating Packages repo =========" | |
echo "=======================================" | |
sudo apt-get -y update && apt-get upgrade |
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
# install using the line below in your terminal | |
#wget --no-check-certificate https://gist.githubusercontent.com/mankind/f44f8232f5d23a774bae/raw/1f53948207b9ff97cf55954f26b2069096b4d82b/ruby_dependencies.sh && bash ruby_dependencies.sh | |
echo "=======================================" | |
echo "========= updating Packages repo =========" | |
echo "=======================================" | |
sudo apt-get -y update && apt-get upgrade |
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
#https://github.com/fesplugas/rbenv-installer/blob/master/bin/rbenv-installer | |
#wget --no-check-certificate https://gist.githubusercontent.com/mankind/de9ef556a579f3980dea/raw/301942dcfd869879d9b1f7224d4bb52d78813bec/rbenv_install.sh && bash rbenv_install.sh | |
sudo apt-get -y update && apt-get upgrade | |
echo "=======================================" | |
echo "========= Cloning Rbenv =========" | |
echo "=======================================" | |
# https://gorails.com/setup/ubuntu/13.10 |
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
class SessionsController < Devise::SessionsController | |
#fix Filter chain halted as :require_no_authentication | |
prepend_before_filter :require_no_authentication, :only => [ :new, :create, :cancel ] | |
#to tackle: Filter chain halted as :verify_signed_out_user | |
skip_before_filter :verify_signed_out_user, only: :destroy | |
# disable it for everything except a few methods | |
#skip_before_action :verify_authenticity_token, :only => :create |
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
// controllers/application.js | |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
currentUser: null, | |
authToken: '', | |
// used to show, or not show, the log out button | |
loggedIn: false, |
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
namespace :api do | |
#when devise_for is called in a namespace, the helpers and controller filters change | |
#:singular => :user added so we can use current_user instead of current_api_user. | |
#And before_filter authenticate_user! instead of authenticate_api_user! | |
#https://github.com/plataformatec/devise/issues/412 | |
#devise_for :users, :singular => :user, skip: :all | |
get :csrf, to: 'csrf#index' | |
resources :users |
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
ember new cms | |
ember generate model page navbar:string title:string body:string | |
import DS from 'ember-data'; | |
export default DS.Model.extend({ | |
navbar: DS.attr('string'), | |
title: DS.attr('string'), | |
body: DS.attr('string'), |
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
//https://github.com/maccman/abba/blob/master/app/assets/javascripts/client/index.coffee | |
var extend, getCookie, host, request, setCookie, | |
slice = [].slice; | |
host = function(url) { | |
var parent, parser; | |
parent = document.createElement('div'); | |
parent.innerHTML = "<a href=\"" + url + "\">x</a>"; | |
parser = parent.firstChild; | |
return "" + parser.host; |
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
#https://rforge.net/doc/packages/Deducer/likelihood.test.html | |
#http://www.pmc.ucsc.edu/~mclapham/Rtips/G%20test.txt | |
# Log-likelihood tests of independence & goodness of fit | |
# Does Williams' and Yates' correction | |
# does Monte Carlo simulation of p-values, via gtestsim.c | |
# | |
# G & q calculation from Sokal & Rohlf (1995) Biometry 3rd ed. | |
# TOI Yates' correction taken from Mike Camann's 2x2 G-test fn. | |
# GOF Yates' correction as described in Zar (2000) |
OlderNewer