Skip to content

Instantly share code, notes, and snippets.

View dmitryshelomanov's full-sized avatar
🎯
Focusing

Shelomanov Dmitry dmitryshelomanov

🎯
Focusing
View GitHub Profile
import { fetchStatus } from 'symbiote-fetching'
export const createMultipleFetching = (baseFetchingsState) => ({
start: (state, fetchingId) => ({
...state,
[baseFetchingsState]: {
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) })
import React from 'react'
import { Input, Item, Label } from 'native-base'
import { StyleSheet } from 'react-native'
export const StackedTextField = ({
innerRef = () => {},
label,
onPress,
inputContainerStyle,
fieldWrapperStyle,
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',
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;
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);
}
}
}
}
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()
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;
};
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
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,