Skip to content

Instantly share code, notes, and snippets.

View georgeguimaraes's full-sized avatar
💭
🧰

George Guimarães georgeguimaraes

💭
🧰
View GitHub Profile
@wevtimoteo
wevtimoteo / retry_github_app_deliveries.js
Last active August 8, 2023 17:01
Retry GitHub app - Deliveries
const GitHubDeliveryManager = {
retryReasons: [
"Couldn't connect to server",
"Service Timeout",
"An Exception Occurred",
"502 Bad Gateway",
"timed out"
],
sleep: function(lf_ms) {
@mislav
mislav / fat-logfiles.sh
Last active December 22, 2018 19:56
Find "*.log" files in your home dir, sort them by fattest-first, and calculate the size of them all together.
find ~ -name '*.log' -print0 | xargs -0 -L1 stat -f'%z %N' | sort -rn | tee fat-logfiles.txt | head
awk '{ total += $1 } END { printf "total: %5.2f MiB\n", total/1024/1024 }' < fat-logfiles.txt
@ches
ches / gist:718234
Created November 27, 2010 20:20 — forked from jpemberthy/gist:349242
Very simple taggable behavior for Mongoid
# Basic tagging system for mongoid documents.
# jpemberthy 2010
#
# class User
# include Mongoid::Document
# include Mongoid::Document::Taggable
# end
#
# @user = User.new(:name => "Bobby")
# @user.tag_list = "awesome, slick, hefty"
@gerhard
gerhard / cijoe-repos_build-hooks
Created April 23, 2010 11:25
CI Joe setup for multiple projects
#!/bin/bash
FULLPATH=`cd $(dirname $0); pwd`
echo $FULLPATH >&2
PROJECT=`echo $FULLPATH | awk -F/ '{print $(NF-3)}'`
STATUS=`echo $0 | awk -F- '{print $NF == "worked" ? "pass" : ($NF == "reset" ? "building" : "fail")}'`
PW=`cat $FULLPATH/../../../../credentials`
curl -u $PW -d"author=$AUTHOR" -- http://ci.domain.com/dashboard/build/$PROJECT/$STATUS
echo "Project: "$PROJECT", Status: "$STATUS", Fullpath: "$FULLPATH >&2