Skip to content

Instantly share code, notes, and snippets.

View consti's full-sized avatar
:shipit:
casting spells

Constantin Hofstetter consti

:shipit:
casting spells
View GitHub Profile
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active November 4, 2024 07:33
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;
}
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active November 15, 2024 12:45 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export to tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

// 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 November 10, 2024 05:28
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 November 10, 2024 13:48
Git CLI Cheatsheet