Skip to content

Instantly share code, notes, and snippets.

View consti's full-sized avatar
:shipit:
Focusing 🦄

Constantin Hofstetter consti

:shipit:
Focusing 🦄
View GitHub Profile
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 3, 2024 13:01
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;
}
// Report on "stuck" ether in empty contracts
// https://github.com/ethereum/EIPs/issues/156
// Usage: node find-stuck-ether.js [startBlock] [endBlock] > report.txt
let Eth = require('ethjs');
let eth = new Eth(new Eth.HttpProvider('http://localhost:8545'));
let ethutil = require('ethereumjs-util')
async function main() {
###
This super simple script loads SlimFAQ content into any page.
Specify a category from SlimFAQ by it's URL, and put a simple
template into the HTML, and this script will auto-load those questions
into the page. When clicked, the links will open inside the SlimFAQ sidebar.
Sample html template:
<div data-slimfaq-category='http://faq.groupmuse.com/323-hosting' data-slimfaq-limit=2>
<h2 data-slimfaq-category-name></h2>
<p data-slimfaq-question-template></p>
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active April 13, 2024 12:22
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@consti
consti / wtd_bangkok.md
Last active August 2, 2016 05:04
What to do in Bangkok

What to do in Bangkok

Allgemeines

Am Flughafen eine Prepaid Simkarte holen (kostet bei True Mobile ca. 400฿ für 30 Tage Internet) - dann Foursquare auf dem Handy installieren und Google Maps (BTS Stationen auf Thai!) und Apple Maps (BTS Stationen auf Englisch!) zur Navigation verwenden.

Geldautomaten in Thailand verrechnen beim Abheben mit einer Ausländischen Geldkarte bis zu 180฿ Gebühr. Deshalb am Besten immer gleich "ausreichend" Geld abheben bzw. Euro mitbringen und am Flughafen in Bangkok (Siam Commercial Bank) oder in der Stadt ("SuperRich Exchange") wechseln: der Kurs hier ist meistens sehr sehr gut.

Nicht auf den "Hat heute geschlossen, ich kann euch was anderes zeigen"-Trick reinfallen. Entspricht meistens nicht der Wahrheit (im Internet nachschauen) und führt nur zum Geschäft des Schwagers ("günstige Anzüge") oder dem Restaurant der Cousine ("real thai food") :).

  • Dynamic Dispatch
  • Dynamic Method
  • Ghost Methods
  • Dynamic Proxies
  • Blank Slate
  • Kernel Method
  • Flattening the Scope (aka Nested Lexical Scopes)
  • Context Probe
  • Class Eval (not really a 'spell' more just a demonstration of its usage)
  • Class Macros
@iqbalhasnan
iqbalhasnan / carrierwave.rb
Last active May 25, 2023 06:06
carrierwave mini_magick image processing - quality, strip, exif rotation, gaussian blur, interlace
#config/initializers/carrierwave.rb
module CarrierWave
module MiniMagick
# Rotates the image based on the EXIF Orientation
def exif_rotation
manipulate! do |img|
img.auto_orient
img = yield(img) if block_given?
img
end
@revans
revans / user_script.sh
Last active October 27, 2020 18:16
AWS User Script for getting a server ready for Ruby, Rails, Sinatra, or Rack apps.
#!/usr/bin/env bash
#
# Author: Robert R Evans
#
# Description: AWS Ubuntu 13 Ruby Setup Script
#
# This script will setup a ubuntu box for Ruby, Rails, Sinatra, and/or Rack
# development/staging/production usage. It also installs Nodejs, Nginx, Git,
# Rbenv, and PostgreSQL adapters for using RDMS PostgreSQL. It assumes that
# git-deploy will be used, in place of the traditional capistrano deployments.
@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet