Skip to content

Instantly share code, notes, and snippets.

View charly-palencia's full-sized avatar

charly palencia charly-palencia

View GitHub Profile
@charly-palencia
charly-palencia / gist:2667293
Created May 12, 2012 15:59
Class variable like global variables
class TestVariable
@@A=1
def print_v
@@A
end
end
@@A="WHY?"
test= TestVariable.new
@charly-palencia
charly-palencia / gist:3164075
Created July 23, 2012 14:59
controller example
We couldn’t find that file to show.
background do
set_omniauth()
click_link_or_button 'Sign up with Facebook'
end
@charly-palencia
charly-palencia / gist:5815337
Last active December 18, 2015 16:59
Pull Request Process

Upstream branch

  • Add remote upstream
 git clone remote add upstream SSH_REMOTE_URI
  • Update the new remote that was added
       git fetch upstream
    

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@charly-palencia
charly-palencia / gist:05a97d58d56e2b6c90ee
Created May 5, 2014 20:20
Create vim add method action (ruby-refactoring.vim plugin)
#/plugin/ruby-refactoring.vim
"
" Author: Enrique Comba Riepenhausen (@ecomba) & Paul King (@nrocy)
" Email: [email protected]
" Email: [email protected]
"
" Acknowledgements:
" Thanks to Gary Bernhardt for the inspiration for this tool and the original
" ExtractVariable() and InlineTemp() functions.
"
//TEST
var sailsServer = require('../../support/sailsServer');
describe('AuthController', function(){
var app;
beforeEach(function(done){
sailsServer.startServer(done);
@charly-palencia
charly-palencia / minitest.rb
Created October 21, 2016 14:25
Include the Dockerfile into vim-test configuration (~/.vim/autoload/test/ruby/minitest.vim)
function! test#ruby#minitest#executable() abort
let docker = ''
if filereadable('./Dockerfile')
let docker = 'docker-compose -f docker-compose.test.yml run --rm web '
endif
if system('cat Rakefile') =~# 'Rake::TestTask' ||
\ (exists('b:rails_root') || filereadable('./bin/rails'))
if !empty(glob('.zeus.sock'))
return docker . 'zeus rake test'
var Location = (function(repository){
var generateGuid = function() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
};
require 'digest'
require 'date'
require 'faraday'
key = "----"
id = "..."
datetime = Time.now.utc.strftime('%Y%m%d%H%M%S')
digest = Digest::MD5.hexdigest("#{id}createsession#{key}#{datetime}")
# url = URI("http://api.smitegame.com/smiteapi.svc/createsessionJson/#{id}/#{digest}/#{datetime}")