Skip to content

Instantly share code, notes, and snippets.

View thcipriani's full-sized avatar

Tyler Cipriani thcipriani

View GitHub Profile
@robacarp
robacarp / deep_thought.rb
Last active February 15, 2018 20:18
Testing ruby mutexs across threads and forks
# Deep Thought is a computer that was created by the pan-dimensional,
# hyper-intelligent species of beings (whose three-dimensional
# protrusions into our universe are ordinary white mice) to come up
# with the Answer to The Ultimate Question of Life, the Universe,
# and Everything. Deep Thought is the size of a small city.
class Worker
MUTEX = Mutex.new
@@mutex = Mutex.new
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 26, 2024 17:22
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@Airblader
Airblader / py3lock.py
Created May 11, 2015 16:41
Obscure only actual windows for i3lock
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# vim:ts=2:sw=2:expandtab
import os
import xcb
from xcb.xproto import *
from PIL import Image
XCB_MAP_STATE_VIEWABLE = 2
@puffnfresh
puffnfresh / chromebook-nix.sh
Last active October 28, 2020 03:06
Installation script for Nix on ChromeOS
#!/bin/sh
sudo mount -o remount,exec /tmp
if [ -x /usr/local/nixstrap/proot-x86_64 ] && [ -h ~/.nix-profile ]; then
echo "Launching shell with nix-* tools!"
exec /usr/local/nixstrap/proot-x86_64 -b /usr/local/nixstrap/nix-1.8-x86_64-linux:/nix bash --init-file ~/.nix-profile/etc/profile.d/nix.sh
fi
set -e
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@yiding
yiding / imapfilter_phabricator.lua
Created June 25, 2014 00:17
Imapfilter function to move all notifications related to phabricator notifications to a different folder
function pruneCommittedDiffs(mailbox, dest_mailbox)
diff_set = mailbox:contain_subject('[Differential]')
committed_diff_set = diff_set:contain_field('X-Phabricator-Mail-Tags', '<differential-committed>')
for _, message in ipairs(committed_diff_set) do
mmbox, uid = table.unpack(message)
rev_key = string.gsub(mmbox[uid]:fetch_field('In-Reply-To'), 'In%-Reply%-To: ', '')
all_diff_msgs = diff_set:contain_field('In-Reply-To', rev_key) + diff_set:contain_field('Message-ID', rev_key)
all_diff_msgs:move_messages(dest_mailbox)
end
end
@hdragomir
hdragomir / sm-annotated.html
Last active March 5, 2024 08:57
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@msohn
msohn / git-big-objects.sh
Last active June 26, 2023 15:31
Script to show n largest objects in a git repo's pack files.
#!/bin/bash
# -----------------------------------------------------------------------
# Copyright (C) 2013 Matthias Sohn <matthias.sohn@sap.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@danguita
danguita / osx-development-setup.md
Last active June 2, 2016 13:37
Set up your shiny OSX for development