Skip to content

Instantly share code, notes, and snippets.

@luislobo
luislobo / install_latest_docker_compose.sh
Last active January 29, 2022 14:52 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@luislobo
luislobo / find_lodash.sh
Created April 2, 2016 03:33
how to find all versions of a package installed inside a node_modules directory
grep version `find -iname lodash -type d -exec find {} -iname package.json \;`
@luislobo
luislobo / setup-and-teardown-sails-programmatically-for-tests.js
Last active February 4, 2016 19:08 — forked from mikermcneil/setup-and-teardown-sails-programmatically-for-tests.js
If you need also Fixtures, you can add sails-hook-fixtures, and configure it like the following:
// Require the default sails singleton (this is the same Sails instance you use globally in your app)
var sails = require('sails');
// setup
before(function(done) {
sails.lift({
// You can customize the port if you want (or use sails.load instead if you are testing using the VRI/sails.request() or just need access to the ORM, etc.)
// port: 4000,
git checkout <feature-branch>
git pull
git checkout <release-branch>
git pull
git merge --no-ff <feature-branch>
git push
git tag -a branch-<feature-branch> -m "Merge <feature-branch> into <release-branch>"
git push --tags
git branch -d <feature-branch>
git push origin :<feature-branch>
@luislobo
luislobo / gist:db5b5d71ff747752da78
Created April 13, 2015 21:26
Verifying that +luislobo is my openname (Bitcoin username). https://onename.com/luislobo
Verifying that +luislobo is my openname (Bitcoin username). https://onename.com/luislobo
@luislobo
luislobo / local.js
Last active August 29, 2015 14:17
SailsJS DB config for replica set
module.exports.connections = {
yourDB: {
host: 'mongodb02.prod.whatever.com',
port: 27017,
database: 'somedb',
schema : true,
replSet: {
servers: [
{
host: 'mongodb01.prod.whatever.com'
@luislobo
luislobo / mimetype.php
Created July 31, 2013 23:07
Yii mimetype.php generator
<?php
/**
* MIME types.
*
* This file contains most commonly used MIME types
* according to file extension names.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright 2008-2013 Yii Software LLC
@luislobo
luislobo / CGridView with CButtonColumns
Last active December 19, 2015 15:49
If you click on Approve or Revoke, all confirmations of all buttons are run. Using Yii 1.1.13
<?php
$rawData = array(
array( 'id' => 1, 'username' => 'User 1', 'email' => 'hello2@example.com' ),
array( 'id' => 2, 'username' => 'User 2', 'email' => 'hello2@example.com' ),
);
$arrayDataProvider = new CArrayDataProvider( $rawData, array( 'id' => 'id' ) );
$this->widget( 'zii.widgets.grid.CGridView',
array(
'id' => 'user-grid',