Skip to content

Instantly share code, notes, and snippets.

View acenqiu's full-sized avatar

Jiangyi Qiu acenqiu

  • Acen Studio
  • Wuhan, Hubei, China
View GitHub Profile
@acenqiu
acenqiu / redis-backup.sh
Last active March 15, 2024 09:59
redis rdb backup script
#!/bin/bash
#
## redis backup script
## usage
## redis-backup.sh port backup.dir
port=${1:-6379}
backup_dir=${2:-"/data/backup/redis"}
cli="/usr/local/bin/redis-cli -p $port"
- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject
atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type
newIndexPath:(NSIndexPath *)newIndexPath
{
if (type == NSFetchedResultsChangeUpdate) {
[[cachedTHJobs objectAtIndex:indexPath.row] refresh];
}
}
- (void)registerNotifications
# config/application.rb
# append to bottom
require 'i18n_time_zone'
@acenqiu
acenqiu / syntax_highlighting.py
Created March 22, 2012 06:58 — forked from phillipkoebbe/syntax_highlighting.py
Syntax highlight switcher for Sublime Text 2
import sublime, sublime_plugin
import os, string, re
class DetectFileTypeCommand(sublime_plugin.EventListener):
""" Attempts to choose the correct syntax when more than one could apply. """
def __init__(self):
super(DetectFileTypeCommand, self).__init__()
self.path = None
@acenqiu
acenqiu / devise.zh-CN.yml
Created October 27, 2011 13:52
# Chinese (China) translations for Devise
# Chinese (China) translations for Devise
# by acenqiu (https://github.com/acenqiu)
# forked from https://gist.github.com/1008642
zh-CN:
errors:
messages:
expired: "您已过期,请重新申请"
not_found: "没有找到"
already_confirmed: "已经确认,请重新登录."