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 / 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>]
% Copyright (c) 2010-2011, Lars Buitinck
% May be used, redistributed and modified under the terms of the
% GNU Lesser General Public License (LGPL), version 2.1 or later
% Heaps/priority queues in Erlang
% Heaps are data structures that return the entries inserted into them in
% sorted order. This makes them the data structure of choice for implementing
% priority queues, a central element of algorithms such as best-first/A*
% search and Kruskal's minimum-spanning-tree algorithm.
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
Sample project for the "Getting started with JavaFX in Clojure" ( https://coderwall.com/p/4yjy1a ) ProTip.
@BillBarnhill
BillBarnhill / gist:2a67c22501e5ed4c8ad69a39c94769fc
Created June 29, 2017 22:35
If you get AbstractMethodError when creating a JMS Session, then this might help (very rough code though)
// Call this, or put in a method and call, where exception is being thrown
URL[] urls = ((URLClassLoader) (Thread.currentThread().getContextClassLoader())).getURLs();
StringBuilder sz = new StringBuilder("Classpath jars [");
sz.append(Integer.toString(urls.length));
sz.append("]...\n");
String searchFor = "jms/Session";
Map<File, String> matches = new HashMap<>();
for (URL url : urls) {
File file = new File(url.getFile());
sz.append(" ").append(file.getAbsolutePath());
@BillBarnhill
BillBarnhill / phoenix_read_more_helper_snippet.ex
Created October 4, 2015 15:42
Example of a Phoenix view helper (put in your view or in App views) that inserts a read more link
@doc """
Inserts a link to the show path of a resource item. The
item must implement .id.
##Example
<%= read_more_link @conn, @post %>
"""
def read_more_link(conn, item) do