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) => { |
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
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
<?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
<!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
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
/** | |
* Middleware that allow to dispatch an array of actions, resulting in a single render | |
* @param next | |
* @returns {Function} | |
*/ | |
export default function reduxBatchMiddleware(next: any) { | |
let nextListeners: any = []; | |
let currentListeners: any; | |
function ensureCanMutateNextListeners() { |
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
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32 | |
global start | |
section .text | |
start: | |
push dword msg.len | |
push dword msg | |
push dword 1 | |
mov eax, 4 |
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 React from 'react'; | |
import { | |
StyleSheet, | |
TouchableOpacity, | |
View, | |
Text, | |
} from 'react-native'; | |
import { useDeleteModal } from "./DeleteModal"; | |
const styles = StyleSheet.create({ |
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 React from 'react'; | |
import { | |
StyleSheet, | |
View, | |
Text, | |
} from 'react-native'; | |
import Modal from "react-native-modal"; | |
const styles = StyleSheet.create({ | |
modal: { |
OlderNewer