Skip to content

Instantly share code, notes, and snippets.

var roc = {
namespace: function(ns) {
var parts = ns.split('.'),
object = this,
i, len;
for (i=0, len=parts.length; i < len; i++) {
if (!object[parts[i]) {
object[parts[i]] = {};
}
object = object[parts[i]];
var $seach, $list;
$seach = $('#seach');
$list = $('#list');
$seach.on('keydown', function(){
var $this = $(this);
setTimeout(function(){
var val = $this.val();
var re = new RegExp(val);
var newlist = $list.find('li').filter(function(item){
docker 部署 gitlab
`wget https://raw.githubusercontent.com/sameersbn/docker-gitlab/master/docker-compose.yml && docker-compose up -d `
var list = [
'Cras justo odio',
'Dapibus ac facilisis in',
'Morbi leo risus',
'Porta ac consectetur ac',
'Vestibulum at eros'
]
var list_set = function () {
list.push('Item '+ new Date().getTime());
$('#list').trigger('update:list');
@lolocoo
lolocoo / jscombinator.js
Created November 28, 2017 06:36
jscombinator
var y = le => (f => f(f)) (f => le(x => (f(f))(x)))
var y = function(le) {
return function(f) {
return f(f);
}(function(f) {
return le(
function(x) { return (f(f))(x); }
@lolocoo
lolocoo / ycombinator.js
Created November 29, 2017 09:40
ycombinator
Deriving the Y Combinator in 7 Easy Steps
December 01, 2010
The Y Combinator is a method of implementing recursion in a programming language that does not support it natively (actually, it's used more for exercising programming brains). The requirement, though, is that language to support anonymous functions.
I chose JavaScript for deriving the Y Combinator, starting from the definition of a recursive factorial function, using a step-by-step transformation over the initial function.
Update
There's now a Chinese translation of this article as well as a Clojure port.
@lolocoo
lolocoo / framework7_city_selector.vue
Created December 13, 2017 07:17
framework7_city_selector
var location = function (target) {
let vendors = {
api: 'http://184.api.kr.xingyuanauto.com/basedata/api?Method=Xy.Kr.BaseData.',
province: [''],
provinceDisplay: [''],
city: [''],
cityDisplay: [''],
cities: {},
citiesDisplay: {},
type: {
@lolocoo
lolocoo / car_slider.html
Created January 11, 2018 07:49
car_slider.html
<!DOCTYPE html>
<!--
Created using JS Bin
http://jsbin.com
Copyright (c) 2018 by anonymous (http://jsbin.com/kibowalije/1/edit)
Released under the MIT license: http://jsbin.mit-license.org
-->
@lolocoo
lolocoo / introrx.md
Created January 19, 2018 07:12 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@lolocoo
lolocoo / introrx.md
Created January 19, 2018 07:12 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing