Skip to content

Instantly share code, notes, and snippets.

💭
😊

Ryan Lv xiaoronglv

View GitHub Profile
@xiaoronglv
xiaoronglv / README.md
Created Sep 28, 2018 — forked from hongymagic/README.md
Simple zsh wrapper to launch iA Writer from the terminal
View README.md

This is a simple script to launch iA Writer from the terminal. It is extremely useful for interacting with Github's own wiki system as it provides git access.

INSTALL

One-liner

curl -L https://raw.github.com/gist/2025540/4f3f094286468db2588f40345e6faaf07bd5af2a/ia > /usr/local/bin/ia && chmod u+x /usr/local/bin/ia

Manual, safer way

View 笔记.md
@xiaoronglv
xiaoronglv / things.rb
Last active Jan 29, 2016
a script to analyze your Things app
View things.rb
#!/usr/bin/env ruby
# Usuage
# things 'thisweek'
# things 'lastweek'
# things 'thismonth'
require 'fileutils'
require 'date'
# please install the following 5 gems.
@xiaoronglv
xiaoronglv / gist:5242be8daacd2a21e00d
Created Nov 21, 2015 — forked from mikedamm/gist:d0ef2291a3c4eecdc35a
Remove McAfee Endpoint Security for Mac without uninstall password
View gist:5242be8daacd2a21e00d
rm -f /Library/LaunchAgents/com.mcafee.menulet.plist
rm -f /Library/LaunchAgents/com.mcafee.reporter.plist
rm -f /Library/LaunchDaemons/com.mcafee.ssm.Eupdate.plist
rm -f /Library/LaunchDaemons/com.mcafee.ssm.ScanFactory.plist
rm -f /Library/LaunchDaemons/com.mcafee.virusscan.fmpd.plist
rm -rf /Library/Application\ Support/McAfee
rm -rf /usr/local/McAfee
shutdown -r now
View gist:aa2a08f23df13216de90
launchctl stop com.mcafee.menulet
launchctl stop com.mcafee.reporter
launchctl remove com.mcafee.menulet
launchctl remove com.mcafee.reporter
sudo su -
launchctl stop com.mcafee.virusscan.fmpd
launchctl stop com.mcafee.ssm.ScanManager
@xiaoronglv
xiaoronglv / things_beta_list_completed_tasks.sh
Created Nov 21, 2015 — forked from rooreynolds/things_beta_list_completed_tasks.sh
Extracting useful data from Things (Cloud beta) via its SQLite database
View things_beta_list_completed_tasks.sh
#Completed tasks (showing their title, start date, completion date and time to complete in days)
sqlite3 -csv -header ~/Library/Application\ Support/Cultured\ Code/Things\ beta/ThingsLibrary.db "SELECT
substr(ZTITLE,0,26) as title,
datetime(ZCREATIONDATE, 'unixepoch', '+31 years', 'localtime') as startdate,
datetime(ZSTOPPEDDATE, 'unixepoch', '+31 years', 'localtime') as completeddate,
round(julianday(datetime(ZSTOPPEDDATE, 'unixepoch', '+31 years', 'localtime')) - julianday
(datetime(ZCREATIONDATE, 'unixepoch', '+31 years', 'localtime')),5) as age
FROM ZTHING WHERE ZSTATUS = 3 ORDER BY completeddate;
@xiaoronglv
xiaoronglv / readme.md
Created Nov 10, 2015 — forked from RaVbaker/readme.md
Reverse engineering Things SQLite tasks database
View readme.md

To open SQLite Things.app database run this command in Terminal.app:

$ sqlite3 ~/Library/Containers/com.culturedcode.things/Data/Library/Application\ Support/Cultured\ Code/Things/ThingsLibrary.db

In SQLite command-line type this query to get your tasks stats:

sqlite> .mode column
sqlite> .header on
sqlite> select zscheduler, zstatus, ztrashed, count(*) from ZTHING where z_ent = 13 group by  zstatus,ztrashed order by Z_pk desc;
ZSCHEDULER  ZSTATUS     ZTRASHED    count(*)
View rails_template.rb
# Using taobao Gem source
# 'http://ruby.taobao.org' => 'https://ruby.taobao.org'
gsub_file 'Gemfile', /^source.*$/,"source 'https://ruby.taobao.org'"
# remove gem
gsub_file "Gemfile", /^gem\s+["']sqlite3["'].*$/,''
gsub_file "Gemfile", /^gem\s+["']turbolinks["'].*$/,''
# install gem
gem 'newrelic_rpm'
View Preferences.sublime-settings
{
"color_scheme": "Packages/User/textmate-solarized/Solarized (Dark).tmTheme",
"default_line_ending": "unix",
"dictionary": "Packages/Language - English/en_GB.dic",
"draw_white_space": "selection",
"find_selected_text": true,
"font_face": "menlo",
"font_size": 12,
"highlight_line": true,
You can’t perform that action at this time.