Skip to content

Instantly share code, notes, and snippets.

View robinboening's full-sized avatar

Robin Böning robinboening

View GitHub Profile
@dino-
dino- / haskell-symbols.md
Last active March 20, 2024 05:38
Haskell symbols

Haskell symbols

When starting out with Haskell, I found it difficult to read a lot of the symbols. I made this document explaining the names of some symbols and how I read them.

:: "has type"

x :: Int

@daxmc99
daxmc99 / cloud_sql_read_only.sql
Last active June 30, 2023 14:55
Make a user read-only after its created via the Google api (ie via Terraform)
-- CREATE read-only user when the user was created via the Google Cloud API (ie terraform)
-- GOOGLE CLOUD by default give fairly broad permissions
-- Prior reading https://stackoverflow.com/questions/13497352/error-permission-denied-for-relation-tablename-on-postgres-while-trying-a-selec
-- https://www.digitalocean.com/docs/databases/postgresql/how-to/modify-user-privileges/
REVOKE ALL ON DATABASE db FROM "dev-readonly";
-- This next line is important
REVOKE cloudsqlsuperuser FROM "dev-readonly";
GRANT USAGE ON SCHEMA public TO "dev-readonly";
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO "dev-readonly";
@tomasdev
tomasdev / style.scss
Created May 25, 2014 22:12
Compass Sprites with Retina support
// Only requirement: save all your .png files in 2x format. As this uses background-size, only IE9+ supported, but will look nice for both retina and non retina devices.
// Just because I like to use <span>s
.icon-sprite {
display: inline-block;
}
// Compass automagically generate sprites
@import 'icon/*.png';
// Override the mixin Compass core uses to generate the width/height/position and include background-size
@mixin sprite-background-position($map, $sprite, $offset-x, $offset-y, $fifth) {
$ypos: round(nth(sprite-position($map, $sprite), 2) / 2);
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@thulstrup
thulstrup / compass-retina-sprites.scss
Created March 20, 2012 19:18
Using Compass to generate normal and retina sprite maps
$sprites: sprite-map("sprites/*.png");
$sprites-retina: sprite-map("sprites-retina/*.png");
@mixin sprite-background($name) {
background-image: sprite-url($sprites);
background-position: sprite-position($sprites, $name);
background-repeat: no-repeat;
display: block;
height: image-height(sprite-file($sprites, $name));
width: image-width(sprite-file($sprites, $name));
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@dx7
dx7 / gist:1333785
Created November 2, 2011 14:33
Installing ruby-debug with ruby-1.9.3-p0
### UPDATE: ruby-debuy19 is no longer maintained, use https://github.com/cldwalker/debugger
# Install with:
# bash < <(curl -L https://raw.github.com/gist/1333785)
#
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
echo "Installing ruby-debug with ruby-1.9.3-p0 ..."
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem