Skip to content

Instantly share code, notes, and snippets.

Denis Ciccale dciccale

Block or report user

Report or block dciccale

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dciccale /
Created Jul 27, 2016
Print http status every `n` seconds
# Print http status every n seconds
# n defaults to 1s
# usage:
# http-ping .5 (500 milliseconds)
# http-ping 2 (2 seconds)
http-ping() {
n=1 && (($#>1)) && n=$2
while true
curl -o /dev/null --silent --head --write-out '%{http_code}\n' $1
dciccale / docker-enter
Last active Jul 29, 2016
docker-enter bash alias to enter a docker container
View docker-enter
# usage docker-enter [CONTAINER_ID]
dockerenter() {
docker exec -it $1 bash
alias docker-enter=dockerenter
dciccale / demo.html
Created Jun 4, 2014
Client-side template engine
View demo.html
<!doctype html>
<script>function t(s,d){for(var k in d)s=s.replace(new RegExp('{{\\s*'+k+'\\s*}}','g'),d[k]);return s;}</script>
<script type="template" id="tmpl">
<h1>Hello {{ name }}!</h1>
var tmpl = document.getElementById('tmpl').innerHTML;
dciccale /
Last active Dec 22, 2015
Binary search function done with 109 bytes of JavaScript


Tiny binary search done with 109 bytes of JavaScript.

dciccale /
Last active May 22, 2018
Cross-browser triggerEvent function done with 127 bytes of JavaScript


Cross-browser function to trigger DOM events.

dciccale /
Created May 11, 2013
Bash script to get the current git branch and last commit
#!/usr/bin/env bash
# checks if branch has something pending
function parse_git_dirty() {
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*"
# gets the current git branch
function parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"
dciccale /
Last active Mar 27, 2016
Cross-browser eventHandler function done with 270 bytes of JavaScript


Cross-browser function to handle DOM events.

dciccale /
Last active Dec 17, 2015
Cross-browser removeEvent function done with 84 bytes of JavaScript


Cross-browser function to remove events from DOM elements.

dciccale /
Last active Dec 16, 2015
Cross-browser addEvent function done with 81 bytes of JavaScript


Cross-browser function to add events on DOM elements.

dciccale /
Last active Dec 11, 2015
hasOwnProperty shim in 115 bytes (counting only the actual function)

hasOwnProperty shim

Cross-browser hasOwnProperty shim in 115 bytes of JavaScript.

You can’t perform that action at this time.