Skip to content

Instantly share code, notes, and snippets.

View maxigimenez's full-sized avatar
🤖

Maxi Gimenez maxigimenez

🤖
View GitHub Profile
[alias]
# Delete any branches that have been merged except master, development and the current branch
cleanup = !git remote prune origin && git branch --merged | egrep -v '(^\\*|master|develop)' | xargs git branch -d
@bahmutov
bahmutov / Docker shell commands.sh
Last active February 9, 2024 07:55
A personal cheat sheet for running local Node project in a Docker container
# See list of docker virtual machines on the local box
$ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1
# Note the host URL 192.168.99.100 - it will be used later!
# Build an image from current folder under given image name
$ docker build -t gleb/demo-app .
@jonobr1
jonobr1 / google-sheet-to-json.js
Last active April 26, 2024 15:41
A node.js script to convert a Google Sheet into a JSON object
/**
* Simple Node.js script to turn a specific page on a Google Sheet
* into a JSON object for the main purpose of HTML Templating.
*
* @author jonobr1 / http://jonobr1.com
*
*/
var https = require('https');
var path = require('path');
@CGavrila
CGavrila / singleton_es6.js
Created August 22, 2015 19:11
Singleton pattern in ECMAScript 6
let _singleton = Symbol();
class Singleton {
constructor(singletonToken) {
if (_singleton !== singletonToken)
throw new Error('Cannot instantiate directly.');
}
static get instance() {
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 17, 2024 12:37
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@FGRibreau
FGRibreau / times.js
Created February 5, 2012 22:45
Ruby .times & .upto & .downto methods in JavaScript
// Ruby = 5.times { |i| puts i }
// JS = (1).times(function(i){console.log(i);})
Number.prototype.times = function(cb) {
var i = -1;
while (++i < this) {
cb(i);
}
return +this;
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')