This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type OrNull<T> = T | null; | |
export type OrUndefined<T> = T | undefined; | |
export type Maybe<T> = OrNull<OrUndefined<T>>; | |
export type StringMap<V> = {[key: string]: V} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Carousel</title> | |
<style type="text/css"> | |
.container { | |
height: 300px; | |
width: 500px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* See http://sylvana.net/jpegcrop/exif_orientation.html | |
*/ | |
function fixOrientation(Imagick $image) { | |
$orientation = $image->getImageOrientation(); | |
switch($orientation) { | |
case 2: | |
$image->flipImage(); | |
break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slugify(text) { | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') | |
.replace(/[éèëê]/g, "e") | |
.replace(/[iïî]/g, "i") | |
.replace(/[àâ]/g, "a") | |
.replace(/[oôö]/g, "o") | |
.replace(/[^\w\-]+/g, '') | |
.replace(/\-\-+/g, '-') | |
.replace(/^-+/, '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Extracts bits out of the decimal num from msb to lsb | |
* | |
* @param num | |
* @param msb the most significant bit | |
* @param lsb the least significant bit | |
* @returns {number} | |
*/ | |
function extractBits(num, msb, lsb) { | |
msb = msb || 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as normalizr from 'normalizr'; | |
/** | |
* Given an object where keys are IDs | |
* Return all the objects and an array of unique IDs | |
* | |
* @param object | |
* @returns {{entities: {}, result: Array}} | |
*/ | |
export const shallowNormalize = (object) => { |
NewerOlder