Skip to content

Instantly share code, notes, and snippets.

View fatso83's full-sized avatar
🐢
Two toddlers. Very little time for OSS after work hours. File a PR!

Carl-Erik Kopseng fatso83

🐢
Two toddlers. Very little time for OSS after work hours. File a PR!
View GitHub Profile
@fatso83
fatso83 / build.rb
Last active July 31, 2016 10:06
Example of automatically adding collections to _config.yml
require "set"
require "pathname"
require "yaml"
docs_folder = "resources/main-project-repo/docs/"
config = YAML.load_file "_config.yml"
version_folders = Pathname.new(docs_folder).children.select do |c|
c.directory?
end

Keybase proof

I hereby claim:

  • I am fatso83 on github.
  • I am kopseng (https://keybase.io/kopseng) on keybase.
  • I have a public key whose fingerprint is 29B6 E6EB DCC3 CFC9 CACC 8209 572F 9EA0 B3F1 325B

To claim this, I am signing this object:

@fatso83
fatso83 / mail-rfc822-address.pl
Created September 13, 2016 08:43
This is why you don't make a regex email validator
# A backup of the main regex from "Mail::RFC822::Address: regexp-based address validation"
# http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
# Regex made available by Paul Warren, 17/09/2012
(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:
\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(
?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[
\t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0
31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\
@fatso83
fatso83 / README.md
Last active September 13, 2016 12:56
Keep an organization team in sync with all of the members. Replace the team id in the script if needed.

Add members

This script is all you need to keep the all-in-makingwaves group include all of the makingwaves org's members. Useful when everyone should have access to a repo.

node add-users.js my.user

That's all. You can optionally pre-set the password as an environment variable to avoid typing it in when prompted:

@fatso83
fatso83 / chrome-fresh
Last active October 4, 2016 10:15
Launch a fresh Chrome browser instance each time. Very useful for profiling.
#!/bin/sh
# This is quite useful for front-enders, as it will launch a fresh
# Chrome instance with no loaded plugins or extensions that messes
# with your performance profiling or network debugging
#
# Install:
# install -m 555 ~/Downloads/chrome-fresh /usr/local/bin/
#
# As an Application, just open the OS X script editor and type
# do shell script "~/bin/chrome-fresh"
@fatso83
fatso83 / slot-machine.html
Last active January 16, 2017 11:30
A spinning slot machine effect, with an overlay at the end that might correspond to the result.
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore.js"></script>
<style>
*{
box-sizing: border-box;
}
body {
overflow: hidden;
}
@fatso83
fatso83 / octopus-description.sh
Last active January 21, 2017 10:43
Skript for å generere en deploybeskrivelse i Octopus med Markdown-formatering
#!/bin/bash
# Skript for å generere en deploybeskrivelse i Octopus med HTML-formatering
if (( $# < 2 )); then
echo "Oppgi commitid-en tilsvarende siste deploy som første argument"
echo "Oppgi kjedenavn (ultra, meny, joker) som andre argument"
echo -e "Eksempel:\n\toctopus-description.sh 8f7c4f6 meny"
exit 1
fi
github_base="https:\/\/github.com\/MWNG\/multikanal.epi7.$2"
@fatso83
fatso83 / observable.js
Created February 1, 2017 12:47
Observable impl - ripped from riot.js 1.0.4. No dependencies.
var observable = function(el) {
var callbacks = {}, slice = [].slice;
el.on = function(events, fn) {
if (typeof fn === "function") {
events.replace(/[^\s]+/g, function(name, pos) {
(callbacks[name] = callbacks[name] || []).push(fn);
fn.typed = pos > 0;
});
}
@fatso83
fatso83 / spinner.svg
Created February 8, 2017 09:09
Animated Spinner SVG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// globals: window, document, $
//
// Feature detect the actual transitionFinished event
// used by the current browser
//
// Used like this:
// var features = {};
// transitionEndFeatureDetection((eventName) => {
// features.transitionFinishedEvent = eventName;
// });