Skip to content

Instantly share code, notes, and snippets.

//
// TransitionController.h
//
// Created by XJones on 11/25/11.
//
#import <UIKit/UIKit.h>
@interface TransitionController : UIViewController
// from http://javascript.ruanyifeng.com/bom/engine.html#toc9
// 防抖动,只有当两次触发之间的时间间隔大于事先设定的值,这个新函数才会运行实际的任务
function debounce(fn, delay){
var timer = null; // 声明计时器
return function(){
var context = this, args = arguments;
clearTimeout(timer);
timer = setTimeout(function(){
fn.apply(context, args);
}, delay);
@worldask
worldask / git commit 丢失解决方案
Last active March 23, 2018 03:54
git commit 丢失解决方案
// 【方案一】
// 1.通过下面的命令找到丢失的commit
git reflog
// 2.通过丢失的commit新建一个branch
git checkout -b recovery 5aw24s2
// 此时我们就回到原点,可以在这个branch上重新操作了。
// 【方案二】
// 运行
git fsck –lost-found
@worldask
worldask / gist:a844db1f356f39b62d17
Created November 24, 2014 03:31
nginx chkconfig
#! /bin/sh
# chkconfig: - 85 15
# description: nginx is a World Wide Web server. It is used to serve
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="nginx daemon"
NAME=nginx
@worldask
worldask / README.md
Created October 27, 2016 07:20 — forked from oodavid/README.md
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@worldask
worldask / run-innobackupex.sh
Created February 14, 2017 06:35 — forked from jmfederico/run-xtrabackup.sh
Script to create full/incremental backups with innobackupex script.
#!/bin/sh
TMPFILE="/tmp/innobackupex-runner.$$.tmp"
USEROPTIONS="--user=XXX --password=XXX"
FILTERTABLES="--include=.*[.].*"
BACKDIR=/var/mysql-bak
BASEBACKDIR=$BACKDIR/base
INCRBACKDIR=$BACKDIR/incr
FULLBACKUPLIFE=3600 #604800 # How long to keep incrementing a backup for, minimum 60
KEEP=1 # Keep this number of backups, appart form the one currently being incremented
@worldask
worldask / innobackupex-restore.sh
Created February 14, 2017 06:36 — forked from dalecaru/innobackupex-restore.sh
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
#!/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"
https://press.one/p/v?s=721bafdb28da4afa40f7ca3453fbaed05cc22e4e3981758c8aa90487e3c547c74e71a81e53cbec980472601eafc1a095f94a170c82d6a3a61b3c7bc46b8eab3d1&h=a7bf787bdd0bbb1de133ee809ba29b38cab664b598800410d9ebb54e693d8026&a=51037757e12fbe0062276917853359854e92108b&f=P1&v=2