Skip to content

Instantly share code, notes, and snippets.

@aristotll
aristotll / jgrowl-example.html
Created October 9, 2016 11:57
A getting started example using jGrowl on cdnjs.
<!DOCTYPE html>
<html>
<head>
<title>jGrowl</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jquery-jgrowl/1.2.12/jquery.jgrowl.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-jgrowl/1.2.12/jquery.jgrowl.min.js"></script>
<script type="text/javascript">
(function($){
$(function(){

识别生僻字

GB2312

字最少的汉字编码,里面的也就是最常用的。在这个字符集里的不可能是生僻字。

辨别方式:

@aristotll
aristotll / .phpstorm.meta.php
Created August 20, 2016 11:00 — forked from barryvdh/.phpstorm.meta.php
Laravel PhpStorm Meta file
<?php
namespace PHPSTORM_META {
/**
* PhpStorm Meta file, to provide autocomplete information for PhpStorm
* Generated on 2016-07-18.
*
* @author Barry vd. Heuvel <[email protected]>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
@aristotll
aristotll / aegisub_note_chinese.md
Created July 10, 2016 00:57 — forked from yin8086/aegisub_note_chinese.md
Aegisub32 Lua Script学习笔记(官方文档翻译总结)

Aegisub32 Lua Script学习

@(日常笔记)

一、整体结构

1. 全局变量——描述脚本元数据

  • script_name
  • script_description
  • script_author
  • script_version
@aristotll
aristotll / switch.lua
Created July 7, 2016 13:16 — forked from picsoung/switch.lua
a switch in Lua
-- fct to simulate a switch
function switch(t)
t.case = function (self,x)
local f=self[x] or self.default
if f then
if type(f)=="function" then
f(x,self)
else
error("case "..tostring(x).." not a function")
end
@aristotll
aristotll / jquery.min.js
Created June 8, 2016 12:42 — forked from laomo/jquery.min.js
生成当前页面url的二维码,供手机扫描访问或分享
/*! jQuery v2.1.1-rc2 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1-rc2",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a
@aristotll
aristotll / doc2dash_python-2.7ja
Created June 6, 2016 08:38 — forked from hirofumi/doc2dash_python-2.7ja
Create Python 2.7ja docset and add to Dash.app
#!/bin/bash
set -e
temporary="$(mktemp -d -t doc2dash_python-2.7ja)"
trap 'rm -rf "${temporary}"' EXIT ERR
cd "${temporary}"
virtualenv .
. ./bin/activate
@aristotll
aristotll / auto-sqlalchemy.py
Created May 17, 2016 16:03 — forked from kennethreitz/auto-sqlalchemy.py
Some code for using schemas as your declarative base with SQL-Alchemy, along with support for Celery's forking.
from sqlalchemy import create_engine, MetaData, Table
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from multiprocessing.util import register_after_fork
Base = declarative_base()
@aristotll
aristotll / quora_follow.py
Created May 12, 2016 12:02 — forked from rmcgibbo/quora_follow.py
Follow all of the top writers on Quora with a python/selenium/chrome hack
from selenium import webdriver
import time
import random
import numpy as np
browser = webdriver.Chrome()
browser.get('https://www.quora.com/login')
raw_input('You need to log in in the browser window. Hit enter here when finished...')
def find(key, dictionary):
for k, v in dictionary.iteritems():
if k == key:
yield v
elif isinstance(v, dict):
for result in find(key, v):
yield result
elif isinstance(v, list):
for d in v:
for result in find(key, d):