Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Alejandro Ventura alexventuraio

🏠
Working from home
View GitHub Profile
@andyyou
andyyou / rails_webpacker_bootstrap_expose_jquery.md
Last active Oct 5, 2021
Rails 5.2 with webpacker, bootstrap, stimulus starter
View rails_webpacker_bootstrap_expose_jquery.md

Rails 5.2 with webpacker, bootstrap, stimulus starter

This gist will collects all issues we solved with Rails 5.2 and Webpacker

Create Project

# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
@hew
hew / _readme.md
Last active Jul 22, 2020
Operator Mono w/ Italics on OSX VIm
View _readme.md

Operator Mono w/ Italics on OSX Vim

View low_level_hello_world.rb
codigo = " p 'hello world' "
pp Ripper.lex(codigo) # Paso 1, Tokenizacion
# [[[1, 0], :on_sp, " "],
# [[1, 1], :on_ident, "p"],
# [[1, 2], :on_sp, " "],
# [[1, 3], :on_tstring_beg, "'"],
# [[1, 4], :on_tstring_content, "hello world"],
# [[1, 15], :on_tstring_end, "'"],
@HenderOrlando
HenderOrlando / Place.js
Created Apr 6, 2016 — forked from PascalAnimateur/Place.js
Geospatial example in Sails.js using native MongoDB query
View Place.js
/* Place model */
module.exports = {
attributes: {
name: {
type: 'string',
required: true
},
View pry-cheatsheet.md

Pry Cheat Sheet

Youtube Tutorial (2013)

Command Line

  • pry -r ./config/app_init_file.rb -- load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb -- load your rails into a pry session

Debugger

@learncodeacademy
learncodeacademy / flightplan-deploy.md
Last active May 12, 2021
Deploy Node.js Apps with Flightplan
View flightplan-deploy.md

##Setup your server (this would ideally be done with automated provisioning)

  • add a deploy user with password-less ssh see this gist
  • install forever npm install -g forever

##Install flightplan

  • npm install -g flightplan
  • in your project folder npm install flightplan --save-dev
  • create a flightplan.js file
@learncodeacademy
learncodeacademy / gist:ebba574fc3f438c851ae
Created Jul 24, 2014
Nginx Node Frontend / Load Balancer / Static Assets Caching
View gist:ebba574fc3f438c851ae
upstream project {
server 22.22.22.2:3000;
server 22.22.22.3:3000;
server 22.22.22.5:3000;
}
server {
listen 80;
location / {
@learncodeacademy
learncodeacademy / gist:5f84705f2229f14d758d
Last active Feb 24, 2021
Getting Started with Vagrant, SSH & Linux Server Administration
View gist:5f84705f2229f14d758d
@tamoyal
tamoyal / gist:10441108
Created Apr 11, 2014
Create super user and database user in Mongo 2.6
View gist:10441108
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
@lttlrck
lttlrck / gist:9628955
Created Mar 18, 2014
rename git branch locally and remotely
View gist:9628955
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote