Skip to content

Instantly share code, notes, and snippets.

View ax003d's full-sized avatar
🏠
Working from home

ax003d

🏠
Working from home
View GitHub Profile
@52cik
52cik / npm.taobao.sh
Last active February 29, 2024 02:56
npm 淘宝镜像配置
npm set registry https://r.npm.taobao.org # 注册模块镜像
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像
npm set ELECTRON_MIRROR https://cdn.npm.taobao.org/dist/electron/ # electron 二进制包镜像
npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像
@clayzermk1
clayzermk1 / README.md
Created August 10, 2012 19:54
jQuery / Twitter Bootstrap List Tree Plugin

jQuery / Twitter Bootstrap List Tree Plugin

Demo: http://jsfiddle.net/clayzermk1/QD8Hs/

Overview

I needed a simple plugin to build a two-tier collapsible list with checkboxes. I wanted it to fit well with Twitter's Bootstrap. I couldn't find one that was simple enough. I hope you enjoy =) Feel free to send feedback.

@pfreixes
pfreixes / gist:3187511
Created July 27, 2012 11:36
Supervisorctl bash autocomplete
# pfreixes, 2012-07-27
# Add to /etc/bash_completion.d/supervisorctl
_supervisor()
{
local cur prev opts base
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
@i-scorpion
i-scorpion / README.txt
Created June 18, 2012 12:24
Twitter bootstrap fixed table header using jQuery
Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled.
Using the code from twitter bootstrap documentation page, this code is customized for table header.
Create the table with following layout -
<table class="table-fixed-header">
<thead class="header">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
@ichord
ichord / gist:2786290
Created May 25, 2012 06:59
SAE storage for Django
# -*- coding: utf-8 -*-
import os, time, random
from django.core.files.base import File
from django.core.files.storage import Storage
from django.conf import settings
from django.core.files import File
import sae.storage
try:
from cStringIO import StringIO
except ImportError:
@DanielleSucher
DanielleSucher / ssl_client.py
Created April 13, 2012 20:15
gevent (py3) test ssl server and client
# import gevent
# import gevent.socket as socket
# import gevent.ssl as ssl
# from gevent import spawn
import socket
import ssl
import pprint
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@dorfire
dorfire / paginator.py
Created April 10, 2012 12:35
MongoDB paginator
from django.core import paginator
from django.core.paginator import EmptyPage, PageNotAnInteger
class Paginator(paginator.Paginator):
def __len__(self):
try:
return super(Paginator, self).__len__()
except TypeError:
return self.object_list.count()
@jrom
jrom / nginx.conf
Created February 7, 2012 17:14
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
@nolim1t
nolim1t / socket.c
Created June 10, 2009 03:14
HTTP Request in C using low level write to socket functionality
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>