Skip to content

Instantly share code, notes, and snippets.

View rafi's full-sized avatar

Rafael Bodill rafi

View GitHub Profile
@XVilka
XVilka / TrueColour.md
Last active March 23, 2026 05:31
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!

@rafi
rafi / INSTALL.md
Last active December 30, 2015 20:19
My Arch Linux installation
@Stanback
Stanback / nginx.conf
Last active February 6, 2026 04:08 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@yakirh
yakirh / test.html
Created October 13, 2013 14:40
Time range exercise
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1 id="message"></h1>
<script type="text/javascript">
var now = new Date,
hours_float = now.getHours()+(now.getMinutes()/60),
@yakirh
yakirh / timer.html
Created October 13, 2013 13:38
JS Timer exercise
<!DOCTYPE html>
<html>
<head>
<title>Timer</title>
</head>
<body>
<h2>Current Time: </h2>
<div id="time"></div>
<script type="text/javascript">
var now;
@yakirh
yakirh / home.php
Created August 6, 2013 09:42
Testing random alphanumeric token exercise
<?php
try
{
$length = 8;
$start_time = microtime(TRUE);
for ($i = 1; $i <= 10000; $i++)
{
$token = $this->rand_alphanumeric($length);
if (strlen($token) !== $length)
throw new Exception('Token "'.$token.'" length is invalid. token length is '.(strlen($token)).' instead of '.$length);
@jpetazzo
jpetazzo / gist:6127116
Created July 31, 2013 23:21
Debian/Ubuntu containers protips, thanks to @spahl
# this forces dpkg not to call sync() after package extraction and speeds up install
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup
# we don't need and apt cache in a container
RUN echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache
@brunobraga
brunobraga / gmail-count
Last active June 15, 2023 11:49
A simple Gmail unread count script for i3status or conky bars, taking care of its own time frequency (avoid overhead in simplistic approaches such as i3status). See --help for documentation and usage details.
#!/usr/bin/python
###############################################################################
#
# file: gmail-count
#
# Purpose: generates a string value representing the Gmail unread email count.
#
# Usage: pipe the i3status with this script (see i3status manpage)
# or use conky.
#
@rafi
rafi / i3status.conf
Last active February 1, 2023 12:33
Rafi's i3status configuration file
# github.com/rafi i3status config
# i3status configuration file
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
@maccman
maccman / jquery.ajax.queue.coffee
Last active January 13, 2018 12:03
Queueing jQuery Ajax requests. Usage $.ajax({queue: true})
$ = jQuery
queues = {}
running = false
queue = (name) ->
name = 'default' if name is true
queues[name] or= []
next = (name) ->