Skip to content

Instantly share code, notes, and snippets.

@travist
travist / debounce.js
Last active October 2, 2021 11:28
How to debounce a $scope.$watch for Angular.js.
['$scope', function($scope) {
var debounce = function(cb) {
var timeout = null;
return function(data) {
if (timeout) {
clearTimeout(timeout);
}
timeout = setTimeout(function() {
cb(data);
}, 200);
@ankurk91
ankurk91 / github_gpg_key.md
Last active June 7, 2024 14:31
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@hfreire
hfreire / qemu_osx_rpi_raspbian_jessie.sh
Last active March 24, 2024 14:35
How to emulate a Raspberry Pi (Raspbian Jessie) on Mac OSX (El Capitan)
# Install QEMU OSX port with ARM support
sudo port install qemu +target_arm
export QEMU=$(which qemu-system-arm)
# Dowload kernel and export location
curl -OL \
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie
# Download filesystem and export location
@mariozig
mariozig / migrate_repo.sh
Last active May 26, 2024 20:57
Migrate repo from GitLab to GitHub Full blog post @ http://ruby.zigzo.com/2015/03/23/moving-from-gitlab-to-github/
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
# +----------------------------------------------------------------------+
# | Licensed Materials - Property of IBM |
# | |
# | (C) Copyright IBM Corporation 2006, 2007, 2008, 2009, 2010 |
# +----------------------------------------------------------------------+
# | Authors: Antonio Cangiano <cangiano@ca.ibm.com> |
# | : Mario Ds Briggs <mario.briggs@in.ibm.com> |
# | : Praveen Devarao <praveendrl@in.ibm.com> |
# +----------------------------------------------------------------------+
@parente
parente / install_latest_docker.sh
Last active February 6, 2022 17:35
Install Docker latest on Ubuntu 14.04 with AUFS as the storage driver
#!/bin/bash
sudo apt-get update
sudo apt-get -y install linux-image-extra-$(uname -r)
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get -y install lxc-docker
0 - Additional Products
707 - 600 GB iSCSI SAN Snapshot Space
4426 - Citrix NetScaler VPX 10.1 200Mbps Platinum
4513 - Dedicated Load Balancer with High Availability and SSL - 150,000 Connections
4612 - 6500 GB iSCSI SAN Replication
4184 - 750GB EVault Disk to Disk Enterprise Backup
4427 - Citrix NetScaler VPX 10.1 200Mbps Standard
902 - CDN Pay as You Go Storage
4028 - .com - 9 year
703 - 350 GB iSCSI SAN Snapshot Space
@gitaarik
gitaarik / git_submodules.md
Last active July 22, 2024 08:56
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@jfromaniello
jfromaniello / Users.js
Created September 12, 2013 13:21
Fetch all the groups a user is member of with ldapjs
var nconf = require('nconf');
var ldap = require('ldapjs');
var async = require('async');
ldap.Attribute.settings.guid_format = ldap.GUID_FORMAT_D;
var Users = module.exports = function(){
var options = this._options = {
url: process.env["LDAP_URL"],
base: process.env["LDAP_BASE"],
bindDN: process.env["LDAP_BIND_USER"],
@Iristyle
Iristyle / gist:5005653
Created February 21, 2013 15:53
Configure HAProxy for userlists

Create SHA512 passwords

# make sure to use a leading space so that the command is not stored in your bash history!!
 mkpasswd -m sha-512 password1
# generates -> $6$yMgsow58.g/Z$mBjHfdVzqcF/LN.iwV23Eyqg.yGPTsp9pOwaStsJ6c4I4zL7BhucVVAkv5guf7OVRr8Pw0mHF4NrWBRCG5ci7/
 mkpasswd -m sha-512 password2
# generates -> $6$RZ86vRkQ$aRKN1HOsk6bDHBbMhS7jSo/p1NGFl4PvwY3KpU.72i./LvITi41nL84EkxOFXl.6Bmhynj/L7pYbfF0rUHtOB0