Skip to content

Instantly share code, notes, and snippets.


WarrenCA warrenca

View GitHub Profile
echo $THE_DATE
#! /usr/bin/env python
import redis
import random
import sys
r = redis.Redis(host = 'localhost', port = 6379)
warrenca / gist:2b29b3f688fe9d784364dd277b392a5d
Created Jul 5, 2020 — forked from dustismo/gist:6203329
How to install leveldb on ubuntu
View gist:2b29b3f688fe9d784364dd277b392a5d
sudo apt-get install libsnappy-dev
tar -xzf leveldb-1.9.0.tar.gz
cd leveldb-1.9.0
sudo mv libleveldb.* /usr/local/lib
cd include
sudo cp -R leveldb /usr/local/include
warrenca / CompanyUserController.php
Created Dec 10, 2018
Laravel Repository Pattern
View CompanyUserController.php
namespace App\Http\Controllers;
use Warrenca\Laravel\Repositories\UserRepository;
* Class CompanyUserController
docker stop etcd; docker rm etcd; docker run -d -p 4001:4001 -p 2380:2380 -p 2379:2379 \
--name etcd /usr/local/bin/etcd \
-name etcd0 \
-advertise-client-urls http://${HostIP}:2379,http://${HostIP}:4001 \
-listen-client-urls, \
-initial-advertise-peer-urls http://${HostIP}:2380 \
-listen-peer-urls \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster etcd0=http://${HostIP}:2380 \
View callback-hell.js
function process(callback) {
var name = "john";
if (name==="john") {
callback(null, "My name is john");
} else {
callback("I am not john");
process(function(error, message) {
warrenca / async-await.js
Last active May 17, 2017
Async/Await ES7
View async-await.js
async function process() {
let name="john";
if (name==="john") {
return Promise.resolve("My name is john");
} else {
return Promise.reject("I am not john");
View 1-restify-server-cheatsheet.js
// Restify Server CheatSheet.
// More about the API:
// Install restify with npm install restify
// 1.1. Creating a Server.
var restify = require('restify');
warrenca /
Created Dec 22, 2016 — forked from yoavniran/
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies

warrenca /
Created Aug 3, 2016 — forked from remmelt/
Post an Atlassian Bamboo build result to Slack
Create a stage in your project, make it the last stage.
Make a task in the stage with this inline script:
#! /bin/bash
/some/path/ "${bamboo.planKey}" "${bamboo.buildPlanName}" "${bamboo.buildResultsUrl}"
You can’t perform that action at this time.