This file contains 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 { fetchStatus } from 'symbiote-fetching' | |
export const createMultipleFetching = (baseFetchingsState) => ({ | |
start: (state, fetchingId) => ({ | |
...state, | |
[baseFetchingsState]: { |
This file contains 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 { ScrollView, View, Animated, Platform } from 'react-native' | |
import { lifecycle, compose, withProps } from 'recompose' | |
const NAVBAR_HEIGHT = 100 | |
const STATUS_BAR_HEIGHT = Platform.select({ ios: 20, android: 24 }) | |
const enhance = withProps({ animated: new Animated.Value(1) }) |
This file contains 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 { Input, Item, Label } from 'native-base' | |
import { StyleSheet } from 'react-native' | |
export const StackedTextField = ({ | |
innerRef = () => {}, | |
label, | |
onPress, | |
inputContainerStyle, | |
fieldWrapperStyle, |
This file contains 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
const gulp = require('gulp') | |
const rename = require('gulp-rename') | |
const postcss = require('gulp-postcss') | |
const connect = require('gulp-connect') | |
const postcssPresetEnv = require('postcss-preset-env') | |
const path = { | |
css: { | |
src: './src/css/app.css', | |
dest: './dist/css', |
This file contains 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
const CELL_SIZE = 5; | |
const CANVAS_WIDTH = 100; | |
const CANVAS_HEIGHT = 64; | |
const CHANCE = 0.9; | |
const CYCLE_TIME = 0; | |
const canvas = document.getElementById("screen"); | |
const ctx = canvas.getContext("2d"); | |
const cells = []; | |
const bufferCells = []; | |
let then = null; |
This file contains 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
mod sort_fn { | |
pub fn bubble_sort<T: Ord>(victim: &mut [T]) { | |
for _ in 0..victim.len() { | |
for j in 1..victim.len() { | |
if victim[j - 1] > victim[j] { | |
victim.swap(j - 1, j); | |
} | |
} | |
} | |
} |
This file contains 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
class JsEngine { | |
constructor(options) { | |
this.options = options | |
this.models = this.options.data || {} | |
this.lifecycle = this.options.lifecycle || {} | |
this.bindings = {} | |
this.elementToUpdate = {} | |
this.root = document.querySelector(this.options.el) | |
this.searchBindModel() | |
this.proxyBind() |
This file contains 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
module BubleSort = { | |
let make = () => { | |
let data = [|4, 3, 5, 0, 1, 10, 8, 2, 9|]; | |
for (i in Array.length(data) - 1 downto 0) { | |
for (j in 0 to i - 1) { | |
if (data[j] > data[j + 1]) { | |
let tmp = data[j]; | |
data[j] = data[j + 1]; | |
data[j + 1] = tmp; | |
}; |
This file contains 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 Prelude hiding (map, filter) | |
map :: (a -> b) -> [a] -> [b] | |
map predicate list = | |
case list of | |
[] -> [] | |
(x:xs) -> predicate x : map predicate xs | |
map' predicate = map predicate |
This file contains 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
use std::rc::{Rc, Weak}; | |
use std::cell::RefCell; | |
type List = Option<Rc<RefCell<Node>>>; | |
type WeackList = Option<Weak<RefCell<Node>>>; | |
#[derive(Debug)] | |
struct Node { | |
data: i32, |