Skip to content

Instantly share code, notes, and snippets.

View BillBarnhill's full-sized avatar
💭
Learning Rust

=Bill.Barnhill BillBarnhill

💭
Learning Rust
View GitHub Profile
@BillBarnhill
BillBarnhill / README.md
Created November 23, 2015 12:20 — forked from marchelbling/README.md
git hooks

Git hooks for better pivotal integration:

  • pre-commit:
    • prevents commiting on a branch that is not suffixed by an issue number. Some special branches (develop, master) and hotfixes are not constrained
    • [optional] lints python/js (+ beautification) files (requires to define the AUTO_LINT_FILES environment variable)
  • prepare-commit-msg: prepend issue number to commit message if it's missing and if it is set in the branch name (see pre-commit hook)
  • post-checkout: [optional] automatically update submodules when checkouting a branch (requires to define the AUTO_SUBMODULE_UPDATE environment variable)

For easy setup:

current="$( pwd )" && cd "$( git rev-parse --show-cdup )" && if [ -d .hooks ]; then cd .hooks && git fetch origin && git reset --hard origin/master && cd ..; else git clone https://gist.github.com/7358077.git .hooks; fi && if ([ ! -f .gitignore ] || ! grep .hooks .gitignore >/dev/null ); then echo -e ".hooks\n" >> .gitignore; fi && find .hooks -maxdepth 1 -type f |
@BillBarnhill
BillBarnhill / pre-receive
Created November 23, 2015 12:21 — forked from pfctgeorge/pre-receive
Git hooks
#!/env/python
# coding: utf-8
from subprocess import check_output, PIPE, Popen
import sys
import re
BADREV = "0000000000000000000000000000000000000000"
@BillBarnhill
BillBarnhill / post-receive
Created November 23, 2015 12:21 — forked from dvdvck/post-receive
git hook
#!/usr/bin/env bash
#Actualiza el servidor de produccion con el merge realizado
#en la rama release
#La informacion se sincroniza con rsync para no tener un repositorio
#en el servidor. NO. Se necesita hacer una copia local. no tiene sentido
#Hacer un puente con ssh y luego ejecutar git pull en el servidor
Push notification from repository
To minimize the delay between a push and a build, it is recommended to set up the post-receive hook in the repository to poke Jenkins when a new push occurs. To do this, add the following line in your hooks/post-receive file, where <URL of the Git repository> is the fully qualified URL you use when cloning this repository.
curl http://yourserver/git/notifyCommit?url=<URL of the Git repository>[&branches=branch1[,branch2]*][&sha1=<commit ID>]
private AtomicReferenceArray<Thread> consumerWorker;
@Override
public void block() throws InterruptedException {
boolean parked=false;
for(int index=0;index<consumer;index++)
{
if(consumerWorker.get(index)==null && consumerWorker.compareAndSet(index, null, Thread.currentThread()))
@BillBarnhill
BillBarnhill / dtls_client.erl
Created August 19, 2016 15:28 — forked from RoadRunnr/dtls_client.erl
Erlang DTLS sample client
-module(dtls_client).
-export([connect/1]).
psk_verify(Username, UserState) ->
io:format("Server Hint: ~p~n", [Username]),
{ok, UserState}.
connect(Port) ->
[application:start(X) || X <- [crypto, asn1, public_key, ssl]],
find src/main/java/com/a/p2/c -name *.java -exec grep -H package {} \; -exec sed -i '' 's/package com.a.p1.c/package com.a.p2.c/‘ {} \; -exec grep -H package {} \;
First move *.java files to new directory. Then use above to change from old package name (e.g., com.a.p1.c) to new package name (e.g., com.a.p2.c).
@BillBarnhill
BillBarnhill / japan-mythical_creatures.txt
Created September 4, 2016 13:52 — forked from seaofclouds/japan-mythical_creatures.txt
A long list of Japanese Mythical Creatures
Inspired by VividDreams' topic: "Mythical Creatures A-Z"
source: http://www.animationsource.org/board/japanese-mythical-creatures-t14593.html
A
* Abumi-guchi - a furry creature formed from the stirrup of a mounted military commander
* Abura-akago - an infant ghost who licks the oil out of andon lamps
* Abura-bō - a spook fire from Shiga Prefecture, in which the shape of a monk can often be seen
* Abura-sumashi - a spirit who lives on a mountain pass in Kumamoto Prefecture
* Akabeko - a red cow involved in the construction of Enzō-ji in Yanaizu, Fukushima
# create an account, create an app
# @see https://apps.twitter.com/
# retrieve the access tokens
# @see https://dev.twitter.com/oauth/reference/post/oauth2/token
# create the file ~/twitter_api
nano ~/twitter_api
Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0"
Sample project for the "Getting started with JavaFX in Clojure" ( https://coderwall.com/p/4yjy1a ) ProTip.