Skip to content

Instantly share code, notes, and snippets.

View htom78's full-sized avatar

htom78

View GitHub Profile
@htom78
htom78 / grab_instagram_users_photos.py
Created March 20, 2017 03:57 — forked from felinx/grab_instagram_users_photos.py
Grab instagram user's photos through client API
# -*- coding: utf-8 -*-
#
# Copyright(c) 2015 http://feilong.me
#
# @author: Felinx Lee <felinx.lee@gmail.com>
#
from tornado.httpclient import HTTPClient, HTTPRequest
from tornado import escape
import hashlib
@htom78
htom78 / nginx.conf
Created December 30, 2015 06:40
Nginnx config for Yii 2 Advanced App Template (subdomains)
# frontend
server {
listen 80;
server_name yii2.lo;
server_tokens off;
client_max_body_size 128M;
charset utf-8;
access_log /var/log/nginx/yii2-access.log main buffer=50k;
@htom78
htom78 / sublime_text_2_useful_shortcuts.md
Created November 6, 2015 03:49 — forked from nuxlli/sublime_text_2_useful_shortcuts.md
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
<?php
function getTaobaoURLFromShortURL($shortURL)
{
$contents = file_get_contents($shortURL);
$pattern = '/d="J_Url" value=\'(.+)\'>./';
preg_match($pattern, $contents, $matches);
return urldecode($matches[1]);
}
function getItemIdFromURL($itemURL)
@htom78
htom78 / osx-10.9-setup.md
Created September 25, 2015 03:01 — forked from kevinelliott/osx-10.9-setup.md
Clean Install – Mac OS X 10.9 Mavericks

Mac OS X 10.9 Mavericks

Custom recipe to get OS X 10.9 Mavericks running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install.

Install Software

The software selected is software that is "tried and true" --- software I need after any fresh install. I often install other software not listed here, but is handled in a case-by-case basis.

Install from App Store

@htom78
htom78 / config.js
Last active August 29, 2015 14:19 — forked from sorrycc/config.js
var join = require('path').join;
var DEFAULT_CONFIG = {
// spm 源
"registry": "http://private-spm-url",
// Rename files
// 详见:https://github.com/jeremyruppel/pathmap
"pathmap": null,
var AppConstants = require('../constants/AppConstants.js');
var AppDispatcher = require('../dispatchers/AppDispatcher.js');
var api = require('../utils/api');
var ActionTypes = AppConstants.ActionTypes;
module.exports = {
create_customer: function(data){
api.customer.create(data);
}
@htom78
htom78 / app.js
Last active August 29, 2015 14:17 — forked from insin/app.js
/** @jsx React.DOM */
var App = React.createClass({
getInitialState: function() {
return {
pageSize: 2
}
}
, render: function() {
@htom78
htom78 / gulpfile.js
Last active August 29, 2015 14:11 — forked from sl-digital/gulpfile.js
//==============================================================================
// H&L GulpJS + Node - Front End Asset Management
//==============================================================================
var gulp = require("gulp"),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
jshint = require('gulp-jshint'),
concat = require('gulp-concat'),
uglify = require('gulp-uglifyjs'),
■db server
・mysql
$ sudo yum install mysql55 mysql55-devel mysql55-server mysql55-common mysql55-libs
$ sudo vim /etc/my.cnf
[mysqld]
character-set-server = utf8
[mysqld_safe]
character-set-server = utf8
[mysql]
default-character-set = utf8