Skip to content

Instantly share code, notes, and snippets.

View hayderimran7's full-sized avatar

Imran Hayder hayderimran7

View GitHub Profile
@Espenhh
Espenhh / branch-blame.sh
Created September 29, 2012 14:55
Script that lists out all branches, how old they are, groups them by merged/notmerged, and "blames" who commited last
#!/bin/bash
# --------------------------- FUNCTIONS ---------------------------------
_line() {
printf %80s |tr " " "-"; echo ""
}
_info() {
echo -e 1>&2 "\033[32m"$@"\033[0m"
}
import graphviz as gv
g1 = gv.Graph(format='svg')
g1.node('A')
g1.node('B')
g1.edge('A', 'B')
print(g1.source)
@danverbraganza
danverbraganza / tox.ini
Created January 26, 2012 00:54
My standard tox.ini file that allows you to run coverage, lettuce, nosetests and lint, and to pick out a given feature or a module for nosetest (So that you don't have to run the whole suite)
[tox]
envlist=py27,lint
[testenv]
downloadcache={homedir}/.pipcache
distribute=True
sitepackages=False
[testenv:py27]
deps=nose
@samrocketman
samrocketman / jenkins_home_gitignore.md
Last active April 19, 2019 17:29
Use JENKINS_HOME as a git repository with the following .gitignore file.

I initialze $JENKINS_HOME as a git repository with the following .gitignore file.

#global types to ignore
*.swp

#Only get job configs and ignore other data
!jobs/*
jobs/*/*
!jobs/*/config.xml
@codesword
codesword / minikube.md
Last active October 31, 2019 21:27
Installing minikube using xhyve driver

###Install docker-machine-driver-xhyve docker-machine-driver-xhyve is a docker machine driver plugin for xhyve native OS X Hypervisor. xhyve is a lightweight OS X virtualization solution. In my opinion, it's a far better option than virtualbox for running minikube. ####Brew On MacOS sierra, download latest using

brew install docker-machine-driver-xhyve --HEAD
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
@heyimalex
heyimalex / runtime-env-build.js
Created June 7, 2017 22:28
create-react-app build script with optional runtime env var injection
const fs = require("fs");
const crypto = require("crypto");
const spawnSync = require("child_process").spawnSync;
// Load the environment using the same code react-scripts uses.
process.env.NODE_ENV = "production";
const clientEnv = require("react-scripts/config/env")().raw;
const REACT_APP_RUNTIME = /^REACT_APP_RUNTIME_/i;
@hrydgard
hrydgard / OpenSLWrap.cpp
Created July 8, 2012 19:48
A minimal implementation of audio streaming using OpenSL in the Android NDK
// Minimal audio streaming using OpenSL.
//
// Loosely based on the Android NDK sample code.
// Hardcoded to 44.1kHz stereo 16-bit audio, because as far as I'm concerned,
// that's the only format that makes any sense.
#include <assert.h>
#include <string.h>
// for native audio
@ikarius
ikarius / md5.groovy
Created February 9, 2010 09:57
How to generate a MD5 hash in Groovy ...
def generateMD5(String s) {
MessageDigest digest = MessageDigest.getInstance("MD5")
digest.update(s.bytes);
new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0')
}
@gclayburg
gclayburg / workflow.gdsl
Last active August 3, 2020 11:29
Jenkins workflow plugin groovy code completion support for IntelliJ IDE
/*
Author: Gary Clayburg
This file allows IntelliJ IDEA to perform basic syntax checking and code completion for
Jenkins workflow groovy scripts. https://github.com/jenkinsci/workflow-plugin
These methods are supported
sh
readFile
node
echo
@coffeencoke
coffeencoke / jenkins-nginx.conf
Created October 13, 2012 16:58
Nginx conf for redirecting jenkins
server {
listen 80; # Listen on port 80 for IPv4 requests
server_name build.yourdomain.com;
access_log /var/log/nginx/jenkins_access.log;
error_log /var/log/nginx/jenkins_error.log;
location ~ ^/static/[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]\/(.*)$ {
#rewrite all static files into requests to the root