Skip to content

Instantly share code, notes, and snippets.

View lostsnow's full-sized avatar
👻
nil

lostsnow lostsnow

👻
nil
  • Litsea
  • Phobos, Mars
View GitHub Profile
<?php
// https://github.com/fuchaoqun/colaphp/blob/2.0/Cola/Ext/GoogleAuthenticator.php
class Cola_Ext_GoogleAuthenticator
{
public static $ttl = 30;
public static $limit = 6;
// Lookup needed for Base32 encoding
private static $map = array(
@lostsnow
lostsnow / se.js
Created May 1, 2014 03:21 — forked from firedfox/se.js
//-----------------------------
// 从这里开始是web端同步来的数据
// 后端应该也需要从web端同步过来
//-----------------------------
// 站点配置
var c = {
// 搜索引擎配置
se: [
[1,'baidu.com','word|wd|w',1,'news,tieba,zhidao,mp3,image,video,hi,baike,wenku,opendata,jingyan'],
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@lostsnow
lostsnow / sorting option select jQuery
Last active January 2, 2016 19:19 — forked from boy3vil/sorting option select jQuery
add chinese char support
<html>
<head>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('button').click(function() {
var options = $('select.whatever option');
var arr = options.map(function(_, o) {
#!/bin/sh
#
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
#
# This script is provided as-is; no liability can be accepted for use.
#
INNOBACKUPEX=innobackupex-1.5.1
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX
TMPFILE="/tmp/innobackupex-restore.$$.tmp"