Skip to content

Instantly share code, notes, and snippets.

View houming818's full-sized avatar

houming818 houming818

View GitHub Profile
@houming818
houming818 / store.go
Created February 18, 2014 13:23
golang中单例模式。
package crawler
import (
"log"
)
type Url string
type Body string
type MemStore struct {

###0x00 在github上初始化repo 在github上开启一个代码库(repository), 具体方式参考github的帮助手册(help) 如下图所示, 现在整个项目了一个中心repo. 所有的项目成员将共用这一个repo.

![](http://grepcode.cn/img/upload/01.png)
01 在github上新建一个新的repo,作为远端的中心repo
@houming818
houming818 / .vimrc
Created July 1, 2017 07:15
vimrc配置,支持语言Python,Golang,JavaScript,HTML,CSS.
"""""""""""""""""""""""""""""""""
" BEGIN OF VIMRC "
" Author: stduolc "
" Email: [email protected] "
" Version: 1.0 "
"""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""
" INIT "
" 初始化 "
@houming818
houming818 / .sls
Created July 17, 2017 06:18
write a salt sls file in pure python.
#!py
import salt.utils
import sys
def _sub_tail(host, port, filename):
import subprocess
@houming818
houming818 / models.py
Last active August 5, 2017 08:09
JournalMixin for django Model
class JournalMixin(object):
def __init__(self, *args, **kwargs):
super(JournalMixin, self).__init__(*args, **kwargs)
logger.error('__Init__ save journal')
old_save = getattr(self, 'save', None)
if old_save is not None:
def new_save(self, *args, **kwargs):
logger.error('new save journal')
try:
old_save.im_func(self, *args, **kwargs)
@houming818
houming818 / controller.js
Created August 7, 2017 12:00
angluarjs dynamic states example
angular.module('MetronicApp').controller('LvsGroupsController', function($model, $scope, localStorageService, $rootScope, $http, $timeout, runtimeStates, $state) {
runtimeStates.addState('lvs', {
name: 'lvs',
url: '/lvs',
data: {pageTitle: 'Lvs中心'},
templateUrl: '/static/views/lvs/main.html',
resolve: {
deps: ['$ocLazyLoad', function($ocLazyLoad) {
return $ocLazyLoad.load({
name: 'MetronicApp',
@houming818
houming818 / controller.js
Created August 7, 2017 12:01
angluarjs dynamic states example
angular.module('MetronicApp').controller('LvsGroupsController', function($model, $scope, localStorageService, $rootScope, $http, $timeout, runtimeStates, $state) {
runtimeStates.addState('lvs', {
name: 'lvs',
url: '/lvs',
data: {pageTitle: 'Lvs中心'},
templateUrl: '/static/views/lvs/main.html',
resolve: {
deps: ['$ocLazyLoad', function($ocLazyLoad) {
return $ocLazyLoad.load({
name: 'MetronicApp',
@houming818
houming818 / controller.js
Created August 7, 2017 12:01
angluarjs dynamic states example
angular.module('MetronicApp').controller('LvsGroupsController', function($model, $scope, localStorageService, $rootScope, $http, $timeout, runtimeStates, $state) {
runtimeStates.addState('lvs', {
name: 'lvs',
url: '/lvs',
data: {pageTitle: 'Lvs中心'},
templateUrl: '/static/views/lvs/main.html',
resolve: {
deps: ['$ocLazyLoad', function($ocLazyLoad) {
return $ocLazyLoad.load({
name: 'MetronicApp',
@houming818
houming818 / controller.js
Created August 7, 2017 12:01
angluarjs dynamic states example
angular.module('MetronicApp').controller('LvsGroupsController', function($model, $scope, localStorageService, $rootScope, $http, $timeout, runtimeStates, $state) {
runtimeStates.addState('lvs', {
name: 'lvs',
url: '/lvs',
data: {pageTitle: 'Lvs中心'},
templateUrl: '/static/views/lvs/main.html',
resolve: {
deps: ['$ocLazyLoad', function($ocLazyLoad) {
return $ocLazyLoad.load({
name: 'MetronicApp',
@houming818
houming818 / controller.js
Last active August 7, 2017 12:03
angluarjs dynamic states example
angular.module('MetronicApp').controller('LvsGroupsController', function($model, $scope, localStorageService, $rootScope, $http, $timeout, runtimeStates, $state) {
runtimeStates.addState('lvs', {
name: 'lvs',
url: '/lvs',
data: {pageTitle: 'Lvs中心'},
templateUrl: '/static/views/lvs/main.html',
resolve: {
deps: ['$ocLazyLoad', function($ocLazyLoad) {
return $ocLazyLoad.load({
name: 'MetronicApp',