Skip to content

Instantly share code, notes, and snippets.

View yinchuan's full-sized avatar

yinchuan yinchuan

View GitHub Profile
@yinchuan
yinchuan / recover_Evernote_from_backup.md
Created June 11, 2022 10:10
Restore a note of Evernote from Time Machine backup
  1. locate Evernote database file in Time Machine
    1. locate Evernote folder/Users//Library/Application\ Support/Evernote
    2. find database fileconduit-storage/https%3A%2F%2Fwww.evernote.com/UDB-User+RemoteGraph.sql
  2. copy the .sql file to some place, let say ~/Download
    1. do not work on the backed up file
    2. do not work on the current Evernote file
  3. find id of the note
    1. copy internal link of the note in Evernote: `evernote:///........///
    2. the second last part if the note id
  4. open terminal
@yinchuan
yinchuan / download_voa.py
Last active April 14, 2022 07:27
下载VOA慢速英语的脚本,下载内容保存在D:\VOA目录下。
# -*- coding: utf8 -*-
# 下载速度很慢,
import urllib2, urllib
import sys
import os
import socket
import re
import socks
@yinchuan
yinchuan / bash-template
Created April 8, 2016 02:52 — forked from renzok/bash-template
A template bash script based on google style guide with little improvements
#!/bin/bash
# Here short description of this script
# This is just a template to be used for writing new bash scripts
###
# Based on Google Style Guide: https://google-styleguide.googlecode.com/svn/trunk/shell.xml
# General remarks
# * Executables should have no extension (strongly preferred) or a .sh extension.
# * Libraries must have a .sh extension and should not be executable
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"<CHANGE-ME>"} # the password for that account
GHBU_GITHOST=${GHBU_GITHOST-"<CHANGE-ME>.github.com"} # the GitHub hostname (see comments)
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted
GHBU_PRUNE_AFTER_N_DAYS=${GHBU_PRUNE_AFTER_N_DAYS-3} # the min age (in days) of backup files to delete
@yinchuan
yinchuan / gist:3402124
Created August 20, 2012 08:14
SQL Server中随机生成指定范围的日期和时间
DECLARE @insert_date datetime;
SET @insert_date = GETDATE();
SET @insert_date = @insert_date + rand() * 1.0/24