Skip to content

Instantly share code, notes, and snippets.

View andi1984's full-sized avatar
🏠
Working from home

Andreas Sander andi1984

🏠
Working from home
View GitHub Profile
@andi1984
andi1984 / save-file-local.js
Created November 15, 2018 15:09 — forked from liabru/save-file-local.js
Save a text file locally with a filename, by triggering a download in JavaScript
/*
* Save a text file locally with a filename by triggering a download
*/
var text = "hello world",
blob = new Blob([text], { type: 'text/plain' }),
anchor = document.createElement('a');
anchor.download = "hello.txt";
anchor.href = (window.webkitURL || window.URL).createObjectURL(blob);
@andi1984
andi1984 / shell.sh
Created September 29, 2018 21:21
Mastodon - Fix folder permissions
sudo docker-compose run --rm -u root web chown -R mastodon:mastodon public/assets public/packs public/system
@andi1984
andi1984 / name-color.js
Created August 15, 2018 18:46
JS - Name that color
/*
+-----------------------------------------------------------------+
| Created by Chirag Mehta - http://chir.ag/projects/ntc |
|-----------------------------------------------------------------|
| ntc js (Name that Color JavaScript) |
+-----------------------------------------------------------------+
All the functions, code, lists etc. have been written specifically
for the Name that Color JavaScript by Chirag Mehta unless otherwise
@andi1984
andi1984 / test.sass
Created August 15, 2018 18:44
Sass comments
// *************************************
//
// First Level
// -> Description
//
// *************************************
// -------------------------------------
// Second Level
// ——————————————————
@andi1984
andi1984 / reverb.rb
Created October 18, 2015 18:42
Sonic Pi - Second workout
live_loop :background do
with_fx :slicer, phase_slide: 100 do |fx|
background_samples = [:bass_trance_c, :bass_thick_c, :ambi_swoosh, :ambi_piano]
s = sample background_samples.choose
control fx, phase: rand(), mix: rrand(0.75, 1), res: rand(1)
control s, pan: rrand(-1,1)
end
sleep 0.5
end
@andi1984
andi1984 / fix_git_sslread_9806.sh
Created October 4, 2017 08:04 — forked from entropiae/fix_git_sslread_9806.sh
git: how to solve "SSLRead() return error -9806" in OSX using brew
$ brew remove git
$ brew remove curl
$ brew install openssl
$ brew install --with-openssl curl
$ brew install --with-brewed-curl --with-brewed-openssl git
@andi1984
andi1984 / keybase.md
Created October 1, 2017 19:50
keybase.md

Keybase proof

I hereby claim:

  • I am andi1984 on github.
  • I am andi1984 (https://keybase.io/andi1984) on keybase.
  • I have a public key ASBMEGbsFo1kCSgM4itOgN9WYG74b6GiGsJDaoauG8rjggo

To claim this, I am signing this object:

(*
http://zoesmith.io
Export Bookmarks from Evernote to Pinboard
v1.4 12th September 2012
This script takes selected notes in Evernote and sends an email for each to Pinboard, extracting each note's title, source URL and associated tags. The user should enter their Pinboard email address in the pinboardEmail property below, and can choose a default tag to add to each bookmark on import.
This code is hacky, horrible and non-error checking (but it worked for me). Don't use on thousands of notes at a time, it'll go all crashy. Try selecting one test note first to see if it works for you.
Change log:
@andi1984
andi1984 / sm-annotated.html
Created July 21, 2016 17:29 — forked from hdragomir/sm-annotated.html
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@andi1984
andi1984 / rAF.js
Created June 23, 2016 22:09 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];