Skip to content

Instantly share code, notes, and snippets.

View smelike's full-sized avatar
🎯
Focusing

smelike smelike

🎯
Focusing
View GitHub Profile
@AlloVince
AlloVince / elastic.md
Last active July 14, 2022 12:52
npm install -g reveal-md && wget -q -O elastic.md https://gist.githubusercontent.com/AlloVince/35dc272fe0f6703b195425e07f22ed38/raw/elastic.md && reveal-md elastic.md

8102年如何入门Elastic

2018.9 @AlloVince


什么是Elastic

数据搜索/ETL/可视化的开源技术栈

@forthxu
forthxu / scrapting_wechat.python
Last active August 31, 2018 04:26
chuansong.me 传送门指定公众号文章采集 && 利用phantomjs对网页进行截图 && 抓取搜狗微信
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import urllib2
import time
import csv
import sys,os
import pymysql
def get_cur_file_dir():
@AlloVince
AlloVince / php_code_review.md
Last active May 7, 2019 07:34
npm install -g reveal-md && wget -q -O php_code_review.md https://gist.githubusercontent.com/AlloVince/a656e2842c7b6a43c81d/raw/php_code_review.md && reveal-md php_code_review.md

PHP Code Review

2015.07.31 @AV


什么是好代码


Quick install PHP 7.0:

1. Install depends PHP 7.0
$ brew install autoconf automake gmp homebrew/versions/bison27 gd freetype t1lib gettext zlib mcrypt
2. Configure PHP 7.0
$ git clone --depth=1 https://github.com/php/php-src.git

$ cd php-src

@satyrius
satyrius / exercise-60.go
Created October 24, 2013 20:11
A Tour of Go. Exercise: Images. Remember the picture generator you wrote earlier? Let's write another one, but this time it will return an implementation of image.Image instead of a slice of data. Define your own Image type, implement the necessary methods, and call pic.ShowImage. Bounds should return a image.Rectangle, like image.Rect(0, 0, w, …
package main
import (
"code.google.com/p/go-tour/pic"
"image"
"image/color"
)
type Image struct{
Width, Height int
@satyrius
satyrius / exercise-36.go
Created October 23, 2013 06:18
A Tour of Go. Exercise: Slices. Implement Pic. It should return a slice of length dy, each element of which is a slice of dx 8-bit unsigned integers. When you run the program, it will display your picture, interpreting the integers as grayscale (well, bluescale) values. The choice of image is up to you. Interesting functions include x^y, (x+y)/2…
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
res := make([][]uint8, dy)
for y := range res {
res[y] = make([]uint8, dx)
for x := range res[y] {
res[y][x] = uint8((x + y) /2)
@jason-fonseca
jason-fonseca / default
Created June 7, 2012 12:50
cat /etc/nginx/nginx.conf
galaxy:/usr/share/nginx/html# cat /etc/nginx/sites-enabled/default
server {
listen *:80; ## listen for ipv4; this line is default and implied
listen [::]:80 default ipv6only=on; ## listen for ipv6
root /usr/share/nginx/www;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
#server_name _;
# location / {
# # First attempt to serve request as file, then
var performance = (function () {
var my = {};
// Wrap a function body in this to return a copy that instruments itself
// If you want this to be useful, you should give your profiled function a name,
// otherwise it will be identified as "", which is less than useful.
my.profile = function (func) {
return function () {
var start = new Date().getTime(),
time,