Skip to content

Instantly share code, notes, and snippets.

View SekibOmazic's full-sized avatar

Sekib Omazic SekibOmazic

View GitHub Profile
@SekibOmazic
SekibOmazic / config.js
Created March 19, 2016 17:27 — forked from mattpodwysocki/config.js
Angular 2 RxJS TypeWriter
System.config({
//use typescript for compilation
transpiler: 'typescript',
//typescript compiler options
typescriptOptions: {
emitDecoratorMetadata: true
},
//map tells the System loader where to look for things
map: {
app: "./src",
@SekibOmazic
SekibOmazic / config.js
Last active April 8, 2016 11:51 — forked from johnlindquist/config.js
angular2 http demo
System.config({
transpiler: 'typescript',
typescriptOptions: {
emitDecoratorMetadata: true
},
map: {
app: './src'
},
packages: {
app: {
@SekibOmazic
SekibOmazic / config.js
Last active May 5, 2016 16:19
angular2 timeflies
System.config({
transpiler: 'typescript',
typescriptOptions: {
emitDecoratorMetadata: true
},
map: {
app: './src'
},
packages: {
app: {
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' +
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' +
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' +
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));';
try {
eval(str);
} catch(e) {
alert('Your browser does not support ES6!')
}
@SekibOmazic
SekibOmazic / MySQL_macOS_Sierra.md
Created May 25, 2017 17:25 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@SekibOmazic
SekibOmazic / opam-editors.txt
Created October 7, 2017 12:59
opam config for VIM and Emacs
Quick setup for VIM
-------------------
Append this to your .vimrc to add merlin to vim's runtime-path:
let g:opamshare = substitute(system('opam config var share'),'\n$','','''')
execute "set rtp+=" . g:opamshare . "/merlin/vim"
Also run the following line in vim to index the documentation:
:execute "helptags " . g:opamshare . "/merlin/vim/doc"
Quick setup for EMACS
@SekibOmazic
SekibOmazic / UIPattern.re
Created October 21, 2017 15:34 — forked from busypeoples/UIPattern.re
Slaying a UI Anti Pattern in ReasonML
/*
Slaying a UI Anti Pattern in ReasonML
Based on Kris Jenkins original writing.
http://blog.jenkster.com/2016/06/how-elm-slays-a-ui-antipattern.html
*/
type remoteData 'e 'a =
| NotAsked
| Loading
| Failure 'e
| Success 'a;
@SekibOmazic
SekibOmazic / README.md
Created October 21, 2017 16:25 — forked from busypeoples/README.md
Making Impossible States Impossible in ReasonML

Making Impossible States Impossible in ReasonML

Introduction

If you have already seen Richard Feldman's talk entitled "Making Impossible States Impossible" or have read "Designing with types: Making illegal states unrepresentable" then you can skip the explanations and just head straight to the Reason examples.

This post is intended to display how to model your Reason Application to prevent creating impossible states. The benefits of being able to design a feature in this way include avoiding having to deal with complex test scenarios regarding defined business rules and a clear documentation of what is possible just by looking at the type definition. Long story short, let's see how this all works by implementing an example.

Requirements

@SekibOmazic
SekibOmazic / reason-remote-data.re
Created October 21, 2017 16:26 — forked from busypeoples/reason-remote-data.re
ReasonML port remote-data
/*
remote-data ported to ReasonML
See also https://github.com/krisajenkins/remotedata
Tools for fetching data from remote sources (incl. HTTP).
*/
type remoteData 'e 'a
= NotAsked
| Loading
@SekibOmazic
SekibOmazic / who_is_my_mummy.sh
Created March 12, 2018 12:20 — forked from joechrysler/who_is_my_mummy.sh
Find the nearest parent branch of the current git branch
#!/usr/bin/env zsh
git show-branch -a \
| grep '\*' \
| grep -v `git rev-parse --abbrev-ref HEAD` \
| head -n1 \
| sed 's/.*\[\(.*\)\].*/\1/' \
| sed 's/[\^~].*//'
# How it works: