Skip to content

Instantly share code, notes, and snippets.

View rwoeber's full-sized avatar

Richard Wöber rwoeber

  • Würzburg, Germany
View GitHub Profile
@opsb
opsb / elm-cache-add.sh
Last active November 4, 2021 18:43
Pulls all elm.json dependencies from github and saves in local cache (requires jq to be installed)
#!/bin/sh
set -e
if [ "$(elm --version)" != "0.19.1" ]; then
echo "Globally installed elm 0.19.1 is required"
exit 1
fi
export packages=~/.elm/0.19.1/packages
@Kyborg2011
Kyborg2011 / repaire-damaged-ext-drive.sh
Created January 22, 2020 11:28
Repairing damaged external drive (flash drive) on OS X
# If "Disk Utility" can't erase a demaged disk and throw errors, like these:
# a) "-69888: Couldn't unmount disk";
# b) "Couldn't modify partition map".
# You can repair disk (if it is damaged partially, just by a program error, while changing partition map of a disk in) by
# FULL ERASING OF A DISK - you can do that ONLY in A COMMAND LINE, using "diskutil" command (on OS X)
# 1. Firstly you must get path of a drive in a system, like this:
diskutil list
# Than complete erasing of a disk:
diskutil eraseDisk free EMPTY /dev/disk4
@thom-nic
thom-nic / _spacing-helpers.scss
Last active September 3, 2020 15:28 — forked from jacurtis/_spacing-helpers.scss
SASS Margin and Padding Helpers Loop. Generates .mts type helper classes.
/*
* Spacing helpers for consistent margin and padding on elements. Uses rems (not px!)
*
* With the current default settings, generates classes like:
* .mts = margin-top: 0.5rem
* .phl = padding-left: 2rem; padding-right: 2rem; // h = horizontal = left/right
*
* Inspired by:
* https://github.com/mrmrs/css-spacing
* https://getbootstrap.com/docs/4.0/utilities/spacing/
@henrik
henrik / 1-progressive_downloader.ex
Last active December 4, 2020 05:41
Example of progressive downloading with HTTPotion, showing percentage and downloaded bytes as you go.
defmodule ProgressiveDownloader do
def run do
url = "https://ia600308.us.archive.org/2/items/HealthYo1953/HealthYo1953_512kb.mp4"
HTTPotion.get url, stream_to: self, timeout: :infinity
receive_data(total_bytes: :unknown, data: "")
end
defp receive_data(total_bytes: total_bytes, data: data) do
@koreno
koreno / README.md
Last active April 1, 2020 10:44
'rebaser' improves on 'git rebase -i' by adding information per commit regarding which files it touched.

Prebase

git-prebase improves on 'git rebase -i' by adding information per commit regarding which files it touched.

  • Each file gets an alpha-numeric identifier at a particular column, a list of which appears below the commit list. (The identifiers wrap around after the 62nd file)
  • Commits can be moved up and down safely (without conflicts) as long as their columns don't clash (they did not touch the same file).

Installation

Add the executable to your path and git will automatically expose it as

@bpierre
bpierre / README.md
Last active February 15, 2024 18:40
Switch To Vim For Good

Switch To Vim For Good

NOTE: This guide has moved to https://github.com/bpierre/switch-to-vim-for-good

This guide is coming from an email I used to send to newcomers to Vim. It is not intended to be a complete guide, it is about how I switched myself.

My decision to switch to Vim has been made a long time ago. Coming from TextMate 1, I wanted to learn an editor that is Open Source (so I don’t lose my time learning a tool that can be killed), cross platform (so I can use it everywhere), and powerful enough (so I won’t regret TextMate). For these reasons, Vim has always been the editor I wanted to learn, but it took me several years before I did it in a way that works for me. I tried to switch progressively, using the Janus Vim distribution for a few months, then got back to using TextMate 2 for a time, waiting for the next attempt… here is what finally worked for me.

Original gist with comments: https://gist.github.com/bpierre/0a0025d348b6001394e0

@chrismdp
chrismdp / s3.sh
Last active July 23, 2024 16:47
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@rbishop
rbishop / README.md
Last active April 26, 2022 15:38
A super simple Elixir server for sending Server Sent Events to the browser.

Generate a new Elixir project using mix and add cowboy and plug as dependencies in mix.exs:

  defp deps do
    [
      {:cowboy, "~> 1.0.0"},
      {:plug, "~> 0.8.1"}
    ]
  end
@thom-nic
thom-nic / osx-for-hackers.sh
Last active August 12, 2019 12:23 — forked from brandonb927/osx-for-hackers.sh
OSX environment setup
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@thom-nic
thom-nic / build.gradle
Last active November 16, 2023 07:35
find the largest classnames in Spring libraries. Also find FactoryFactories
/**
* Find the longest class names in Spring.
* Also find FactoryFactory classes.
* a goof-off project by @thom_nic
*/
import java.util.jar.*
defaultTasks 'longest', 'factoryfactory'