Skip to content

Instantly share code, notes, and snippets.

💜
Testing statuses

Mikael Brevik mikaelbr

💜
Testing statuses
Block or report user

Report or block mikaelbr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View flow-intro.md

Table of Contents

  1. Basic syntax
  2. Flow Examples
  3. Advanced features
  4. Using with existing libraries (flow-typed and libdefs)
  5. Tooling
  6. Try

1. Basics

View js-newsletters.md

Nyhetsbrev

Vanskelig å vite hvordan man skal få med seg det som skjer i frontend-verden? Her er en liten liste av nyhetsbrev som har mye oppsummering rundt det som skjer. Det er litt forskjell fra uke til uke hvor bra det faktisk er, og ikke alt er relevant til en hver tid. Men det er en veldig godt sted å starte dersom man ønsker å holde seg oppdatert på en enkel måte.

  • Artikler skrevet og oppsummeringseposter en gang i blant. Generelt bra innhold om JavaScript – https://ponyfoo.com/weekly
  • Nyhetsbrev med oppsummering av populære ting denne uken. Har en tendens til å være litt rammeverksorientert, men noen ganger kommer det noen juveler: http://javascriptweekly.com/
  • Samme provider som JSWeekly, men med mer fokus på nettlesere og generelt om web. Har og en tendens til å ha litt rammeverksfokus, men det er og info om hva som kommer av web API-er osv: http://frontendfocus.co/
  • Kurert liste i større grad enn JSWeekly og Front End Focus, og dekker et bredere spekter av Web-en. Har en fin "manuell oppsumm
View languages-number.json
{"num":"1082742","language_name":"JavaScript"}
{"num":"808714","language_name":"CSS"}
{"num":"738253","language_name":"HTML"}
{"num":"630795","language_name":"Shell"}
{"num":"527901","language_name":"Python"}
{"num":"414638","language_name":null}
{"num":"382513","language_name":"Ruby"}
{"num":"363796","language_name":"Java"}
{"num":"350048","language_name":"PHP"}
{"num":"300271","language_name":"C"}
View label-arrow.js
// Doesn't throw an error, but doesn't return an object
const getObj = () => { a: 1 };
console.log(getObj()); //=> val 'undefined' : void
// Reason: It looks lika an arrow function returning an object, but it isn't.
// It's an arrow function with statements returning nothing.
const getObj = () =>
{ // <- Start function body
a: // <- Statement 1: A label to use when break/continue; e.g. break a;
1 // <- Statement 2: Just a noop expression statement, not doing anything.
View luke12.ml
#load "str.cma";;
let message = "Your message was received with gratitude! We do not know about you, but Christmas is definitely our favourite holiday. The tree, the lights, all the presents to unwrap. Could there be anything more magical than that?! We wish you a happy holiday and a happy new year!";;
let roman_to_digit num =
match num with
| 0 -> "0"
| 1 -> "I"
| 2 -> "II"
| 3 -> "III"
| 4 -> "IV"
| 5 -> "V"
View luke9.ml
#load "str.cma";;
module StringMap = Map.Make (String);;
let read_file filename =
let lines = ref [] in
let chan = open_in filename in
try
while true; do
lines := input_line chan :: !lines
done; !lines
with End_of_file ->
View luke7.ml
#load "str.cma";;
let read_file filename =
let lines = ref [] in
let chan = open_in filename in
try
while true; do
lines := input_line chan :: !lines
done; !lines
with End_of_file ->
close_in chan;
@mikaelbr
mikaelbr / init.coffee
Last active Apr 19, 2017
Atom sync settings.
View init.coffee
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
View freq-synth.js
let xRes = window.innerWidth - 50;
let yRes = window.innerHeight - 50;
var backgroundColor = [0, 0, 0];
var frequency = [];
var seriesDistance = 15;
var y;
You can’t perform that action at this time.