Skip to content

Instantly share code, notes, and snippets.

View ygmpkk's full-sized avatar
😬
No more monkeys jumping on the bed

Timothy ygmpkk

😬
No more monkeys jumping on the bed
  • didi
  • Hangzhou
View GitHub Profile
@ygmpkk
ygmpkk / sslocal.service
Created February 22, 2015 08:16
ShadowSocks Client Systemd Service
[Unit]
Description=Daemon to start Shadowsocks Client
Wants=network-online.target
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/sslocal -c /etc/shadowsocks/client.json --pid-file /var/run/sslocal.pid --log-file /var/log/sslocal.log
[Install]
@ygmpkk
ygmpkk / Dockerfile
Created February 23, 2015 09:55
dockerfile source list
FROM ubuntu:14.04
ENV DEBIAN_FRONTEND noninteractive
##///*******************************************************/
##//------------------------
## append apt mirror for ubuntu, update & install
##//------------------------
## RUN sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list
RUN echo "deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse" > /etc/apt/sources.list
RUN echo "deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse" >> /etc/apt/sources.list
RUN echo "deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse" >> /etc/apt/sources.list
@ygmpkk
ygmpkk / ElasticSearch.sh
Last active September 4, 2015 09:47 — forked from ricardo-rossi/ElasticSearch.sh
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
export VIRTUAL_ENV_DISABLE_PROMPT=1
ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX="("
ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX=")"
function virtualenv_prompt_info() {
if [ -n "$VIRTUAL_ENV" ]; then
if [ -f "$VIRTUAL_ENV/__name__" ]; then
@ygmpkk
ygmpkk / client.py
Created October 5, 2015 14:51 — forked from mattbennett/client.py
Greenthread worker
import eventlet
eventlet.monkey_patch()
from eventlet.greenpool import GreenPile
from kombu.pools import producers
from kombu import Exchange, Queue
exchange = Exchange('exchange', type='direct')
queue = Queue('queue', exchange, routing_key='queue')
@ygmpkk
ygmpkk / best_practices.md
Created July 26, 2016 01:05 — forked from alanpeabody/best_practices.md
Ember Best Practices

Ember Best Practices

Some thoughts and ideas on best practices building Ember apps after 2 years building and maintaining 6+ apps. This is less about the obvious best practices, like use ember-cli, and more along the lines of when to use what technique. As with every best practice there are exceptions to every rule.

Ember data

Ember data relationships

Routing

Keybase proof

I hereby claim:

  • I am ygmpkk on github.
  • I am ygmpkk (https://keybase.io/ygmpkk) on keybase.
  • I have a public key whose fingerprint is 447C A6EA 69CD 0E72 6058 0931 71C2 518C E3E2 FF87

To claim this, I am signing this object:

@ygmpkk
ygmpkk / test.js
Created November 1, 2016 03:07
es6 firefix44 problem
'use strict';
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
function test(args) {
var _args = _slicedToArray(args, 2);
var a = _args[0];
var b = _args[1];
@ygmpkk
ygmpkk / default.conf
Created March 10, 2017 09:37
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
<template>
<view class="container">
<view>
<view>
父组件
</view>
<view>
{{ data.today.format('YYYY-MM-DD') }}
</view>