Skip to content

Instantly share code, notes, and snippets.

View paranoidjk's full-sized avatar

paranoidjk paranoidjk

View GitHub Profile
@paranoidjk
paranoidjk / common.css
Last active March 15, 2016 12:23
a common css class gather
.l {
float: left
}
.r {
float: right
}
.cl {
clear: both
}
.n {
@paranoidjk
paranoidjk / .gitconfig
Created January 21, 2016 05:01
some very useful git alias
[alias]
co = checkout
ci = commit
br = branch
st = status
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
# Path to your oh-my-zsh installation.
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/mysql/bin:$PATH
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="cloud"
@paranoidjk
paranoidjk / formComponent.js
Created January 22, 2016 06:26 — forked from arqex/formComponent.js
10.nonFunctionalReact
var MyForm = React.createClass({
render: function(){
return (
<ValidationForm ref="form" onSubmit={ this.validates }>
<Input name="title" validation="required" />
<Input name="age" validation="required,number" />
<Input name="email" validation={ value => value.match(/\S+@\S+\.\S+/) } />
</ValidationForm>
);
},
import tinify
import os
import os.path
tinify.key = "your AppKey" # AppKey
fromFilePath = "/Users/tangjr/Desktop/test1" # 源路径
toFilePath = "/Users/tangjr/Desktop/test2" # 输出路径
for root, dirs, files in os.walk(fromFilePath):
for name in files:
@paranoidjk
paranoidjk / Package Control.sublime-settings
Created January 25, 2016 12:54 — forked from nick1m/Package Control.sublime-settings
Sublime Text 3 There are no packages available for installation
# Сначала оказалось, что лежал сайт (в конце ответа лежит решение позволяющее обойти и эту проблему),
# проверяем https://packagecontrol.io/channel_v3.json, но и после возобновления проблема не ушла.
# Добавляем в настройки плагинов для пользователя (Preferences > Package Settings > Package Control > Settings - User) каналы:
"channels":
[
"https://packagecontrol.io/channel_v3.json",
"https://web.archive.org/web/20160103232808/https://packagecontrol.io/channel_v3.json",
"https://gist.githubusercontent.com/nick1m/660ed046a096dae0b0ab/raw/e6e9e23a0bb48b44537f61025fbc359f8d586eb4/channel_v3.json"
import requests
from db import db
"""
The Douban Group API which not display on http://developers.douban.com/wiki/?title=api_v2
Base url: https://api.douban.com/v2
Group info: /group/:id
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs.
# Requires EditorConfig JetBrains Plugin - http://github.com/editorconfig/editorconfig-jetbrains
# Set this file as the topmost .editorconfig
# (multiple files can be used, and are applied starting from current document location)
root = true
# Use bracketed regexp to target specific file types or file locations
[*.{js,json}]
@paranoidjk
paranoidjk / ga.php
Created February 14, 2016 05:43
自动更新VPN密码到Keychain
<?php
error_reporting(0);
$key = strtoupper($argv[1]);
$lut = array(
'A' => 0, 'B' => 1, 'C' => 2, 'D' => 3,
'E' => 4, 'F' => 5, 'G' => 6, 'H' => 7,
'I' => 8, 'J' => 9, 'K' => 10, 'L' => 11,
@paranoidjk
paranoidjk / gist:2f6e3624b8b2d5e213cb
Created February 24, 2016 10:47
osx 将当前文件夹以及子文件夹所有.png 修改为.jpg
find . -name "*.png"|sed 's/.png//'|xargs -n1 -I {} mv {}.png {}.jpg