Skip to content

Instantly share code, notes, and snippets.

View asaaki's full-sized avatar
🦀
Oh crab!

Christoph Grabo asaaki

🦀
Oh crab!
View GitHub Profile
@cuth
cuth / debug-scroll.md
Last active October 18, 2024 08:22
Find the elements that are causing a horizontal scroll. Based on http://css-tricks.com/findingfixing-unintended-body-overflow/

Debug Horizontal Scroll

(function (d) {
    var w = d.documentElement.offsetWidth,
        t = d.createTreeWalker(d.body, NodeFilter.SHOW_ELEMENT),
        b;
    while (t.nextNode()) {
        b = t.currentNode.getBoundingClientRect();
 if (b.right > w || b.left < 0) {
@staltz
staltz / introrx.md
Last active April 21, 2025 04:15
The introduction to Reactive Programming you've been missing
@brainstorm
brainstorm / piperget.sh
Last active August 29, 2015 14:02
piperget.sh: Fetching pipermail gzipped archives and converting them to .mbox format
#!/bin/sh
# Usage: piperget.sh https://mail.nmr.mgh.harvard.edu/pipermail/freesurfer/
# automated retrieval of pipermail archives & conversion to mbox file
# Last edit: 2012/10/09 Tue 23:16 PDT
listname=$(echo "$1" | sed 's:^\(http.*\)/\([^/]*\)/$:\2:')
cd /tmp
wget -r -l 1 -nH -A *.txt.gz "$1"
touch /tmp/pipermail/$listname/$listname.mbox
chmod 600 /tmp/pipermail/$listname/$listname.mbox
cd /tmp/pipermail/$listname
@olslash
olslash / console
Created June 16, 2014 21:11
Testing the console's representation of data
var externalObj = {key: 'value'};
var items = {
obj: {
'string prop': 'string val',
5: 10,
nested: [[3, [5, 2]]],
'function': function(){return true;},
reference: externalObj
},
defmodule Rotor do
@doc """
Starts a new rotor as part of a supervision tree.
## Options
* `:name` - the registered name of the rotor
"""
def start_link(paths, opts) do

Or what the hell do #![no_start], #![no_main], #[lang = "start"], #[start], and #[main] do?

Crate Attributes:

#![no_start]

Disable automatically linking in the native crate and thus the default start lang item.

Which means you'll probably need one of: #![no_main], #![lang = “start”] or #[start] instead

@sergejmueller
sergejmueller / ttf2woff2.md
Last active March 9, 2024 13:37
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
augroup elixir
au!
au BufNewFile,BufRead *.ex,*.exs noremap <buffer> <leader>t :!mix test %<cr>
au BufNewFile,BufRead *_test.exs noremap <buffer> <leader>t :!mix test %<cr>
augroup END
defmodule M do
defmacro common_fields(extra \\ []) do
[color: nil, id: nil] ++ extra
end
end
defmodule Pawn do
import M
defstruct common_fields
end
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive