Skip to content

Instantly share code, notes, and snippets.

View bwangelme's full-sized avatar
🚀
把 Star 当做收藏在用,点起来很随性。GitHub 全是各种 Tutorial 和 Demo

bwangel bwangelme

🚀
把 Star 当做收藏在用,点起来很随性。GitHub 全是各种 Tutorial 和 Demo
View GitHub Profile
@kagamimoe
kagamimoe / gist:42a3f1b8ff1dc60304b43e9bc64409cf
Last active July 30, 2017 05:17
a python crawler to find the job information
# -*- coding: utf-8 -*-
import urllib2
import sys, smtplib, poplib
from email.mime.text import MIMEText
reload(sys)
sys.setdefaultencoding('utf-8')
from bs4 import BeautifulSoup
@bwangelme
bwangelme / order1.conf
Last active October 16, 2017 15:07
agentzh 的 Nginx 教程的学习笔记
server {
listen 9091;
# Nginx 请求执行阶段
# 1. rewrite
# set 指令在 rewrite 阶段执行。
# 2. access
# 3. content
# echo 指令在 content 阶段执行。
location /test {
@dongweiming
dongweiming / resume.py
Created October 11, 2016 02:56
Python版本简历
#/usr/bin/env python
# coding=utf-8
import random
import re
def color(messages):
color = '\x1B[%d;%dm' % (1,random.randint(30,37))
return '%s %s\x1B[0m' % (color,messages)
@bwangelme
bwangelme / [ubuntu 16.04 & deepin 15.2 Desktop]gvim compile script
Last active September 25, 2017 14:03
gvim compile script on ubuntu 16.04, add python2/3, ruby, lua, gui support
#!/bin/bash
# checking for xmkmf... no
# checking for X... (cached) no
# checking if X11 header files can be found... no
# checking --enable-gui argument... no GUI support
# checking for X11/SM/SMlib.h... (cached) no
## if you meet the above situation on ubuntu 16.04, please follow the following cmd
# sudo apt-get install xorg-dev
import itertools
ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ALPHABET_LEN = len(ALPHABET)
ALPHABET_INDEX = {c: i for i, c in enumerate(ALPHABET)}
def a2n(letter):
return ALPHABET_INDEX[letter]
@nkbt
nkbt / .eslintrc.js
Last active May 5, 2024 07:31
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@hoitomt
hoitomt / log_request.go
Created January 30, 2015 12:56
Golang: Log HTTP Requests in Go
package main
import (
"fmt"
"log"
"net/http"
"os"
)
func main() {
@drgarcia1986
drgarcia1986 / __main__.py
Last active August 9, 2023 21:20
Example of OAuth2 autentication server with Client Credentials grant (using python-oauth2 and tornado)
# !/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Diego Garcia'
import tornado.web
import tornado.ioloop
import oauth2.tokengenerator
import oauth2.grant
import oauth2.store.redisdb
import oauth2.store.mongodb
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@mwhittaker
mwhittaker / client.go
Last active November 16, 2023 06:01
Go Echo Server and Client
package main
import (
"fmt"
"net"
"os"
"time"
)
const (