Skip to content

Instantly share code, notes, and snippets.

@GlitchWitch
GlitchWitch / rtl8156-ubuntu.md
Last active March 4, 2024 14:47
Setup the RTL8156 USB2.5G Ethernet Adapter on Ubuntu 20.04
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active March 23, 2024 20:24
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@andsens
andsens / sign_s3.gs
Last active August 9, 2016 18:21
Google spreadsheet function for signing S3 URLs (very handy for CSV cost allocation reports when combined with the ImportData() function)
function sign_s3(access_key, private_key, bucket, object_name, validity, base_url) {
if(!base_url) {
base_url = "http://s3.amazonaws.com";
}
if(!validity) {
validity = 60;
}
expires = Math.floor((new Date()).getTime() / 1000) + validity;
object_name = encodeURIComponent(object_name);
stringToSign = "GET\n\n\n"+expires+"\n/"+bucket+"/"+object_name;
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@blacktaxi
blacktaxi / ruby-fmt.clj
Created January 25, 2012 14:42
Ruby-like string interpolation in Clojure
; Ruby has an awesome feature -- string interpolation. Read about it on the internet.
; On the other hand, Clojure only has cumbersome Java string formatting, which can not be
; used without pain after you've tried Ruby.
; So here's this simple macro that basically allows you to do most things you could do
; with Ruby string interpolation in Clojure.
(ns eis.stuff
(:require [clojure.string]))
@cheenu
cheenu / netflix_api_sample_signed_request.rb
Last active November 2, 2022 06:22
How to generate an OAuth signature for the Netflix API using Ruby
## This gist is intended to provide a code example for the
# 'Making Signed Requests' section of the 'Authentication Overview' document.
# (http://developer.netflix.com/docs/Security).
#
# We are going to make a catalog request. The hardest part of
# it is figuring out how to generate the oauth_signature.
require 'cgi'
require 'base64'
require 'openssl'
@peterc
peterc / dnsd.rb
Created December 2, 2011 23:47
Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL
@headius
headius / output
Created May 19, 2011 21:58
Rubinius's actor API under JRuby
~/projects/jruby ➔ jruby rbx_actor_example.rb
Processing: 0
Processing: 4
Processing: 7
Processing: 5
Processing: 8
Processing: 3
Processing: 2
Processing: 6
Processing: 1
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb: