Skip to content

Instantly share code, notes, and snippets.

View svnlto's full-sized avatar
🦙

Sven Lito svnlto

🦙
View GitHub Profile
@svnlto
svnlto / index.js
Last active August 17, 2016 05:12
import IO from 'socket.io-client';
import Promise from 'bluebird';
import streamToPromise from 'stream-to-promise';
import fs from 'fs';
const io = IO('http://localhost:3000', {
reconnect: true
});
export default (() => {
@svnlto
svnlto / -
Created August 15, 2016 06:24
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Plugin 'gmarik/vundle'
Plugin 'matchit.zip'
import mongoose from 'mongoose';
import grid from 'gridfs-stream';
import config from 'config';
import url from 'url';
const mongodb = config.get('mongodb');
const { Schema } = mongoose;
grid.mongo = mongoose.mongo;
" let Vundle manage Vundle
" required!
Plugin 'gmarik/vundle'
" Editing
Plugin 'matchit.zip'
Plugin 'repeat.vim'
Plugin 'surround.vim'
Plugin 'vim-indent-object'
Plugin 'scrooloose/syntastic'
@svnlto
svnlto / README.md
Created February 18, 2016 13:40 — forked from yang-wei/README.md
ES6 destructing (and rest parameter)

We will first discussed how destructing and rest parameters can be used in ES6 - in arrays and objects. Then we will look at a few examples and also discuss some quiz.

arrays

var array = [1, 2, 3, 4];
var nestedArray = [1, 2, 3, 4, [7, 8, 9]];

var [a, b, c, d] = array;
console.log(a, b, c, d)
set -g default-terminal "screen-256color"
set-option -g default-command "reattach-to-user-namespace -l $SHELL"
# start windows and panes at 1
set -g base-index 1
set -g pane-base-index 1
# use vi mode
setw -g mode-keys vi
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Plugin 'gmarik/vundle'
export const login = (payload) => {
return dispatch => {
dispatch({ type: LOGIN });
const data = {
username: payload.username,
password: payload.password,
client_id: CLIENT_ID,
@svnlto
svnlto / app.js
Last active November 25, 2015 13:22
import React, { Component, StyleSheet, Navigator } from 'react-native';
import { connect } from 'react-redux/native';
import MainContainer from './MainContainer';
const styles = StyleSheet.create({
navigator: {
flex: 1
}
});
'use strict';
var React = require('react/addons');
var PureRenderMixin = React.addons.PureRenderMixin;
var MAX_LOADING_TASKS = 3;
var loadingQueue = [];
var loadingQueueDirty = false;
var loadingTasks = 0;