This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
I changed some parts of http://foolsworkshop.com/applescript/2008/05/an-applescript-replace-text-method/ | |
*) | |
on removeText(unwanted, theText) | |
set prevTIDs to text item delimiters of AppleScript | |
set text item delimiters of AppleScript to unwanted | |
set theText to text items of theText | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
for file in $1/* | |
do | |
width=$(sips -g pixelWidth "$file" | cut -s -d ':' -f 2 | cut -c 2-) | |
if (($width>720)); then | |
sips --resampleWidth 720 "$file" | |
fi | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Finder" | |
set thePath to POSIX path of (target of window 1 as alias) | |
set the clipboard to thePath | |
end tell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
if select multiple items, copy paths of them with one in each line; | |
if select an item, copy its path; | |
if none is selected, copy the current folder path. | |
*) | |
tell application "Finder" | |
set sel to the selection | |
if (count of sel) is greater than 1 then | |
set theList to "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
if select multiple items, copy paths of them with one in each line; | |
if select an item, copy its path; | |
if none is selected, copy the current folder path. | |
*) | |
tell application "Finder" | |
set sel to the selection | |
if (count of sel) is greater than 1 then | |
set theList to "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import sys | |
from pypinyin import pinyin | |
import pypinyin | |
def getPinyin (x): | |
y = pinyin(unicode(x,'utf-8'), style=pypinyin.TONE2) | |
lst = [] | |
for e in y: | |
lst = lst + e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set n to the clipboard | |
# the default option used is `rounding to nearest` | |
# four decimal | |
(round (n * 10000)) / 10000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\begin{figure}[ht] | |
\caption{Caption}\label{fig1} | |
\floatfoot{Data source: Yearbook (\cite{NBS:2000})} | |
\centering | |
\begin{tikzpicture} | |
\datavisualization | |
[scientific axes=clean, | |
x axis={ | |
attribute=year, | |
length=4cm, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
author: lsfalimis | |
blog: http://lsfalimis.github.io/ | |
Stata setup: Stata 13 on Win | |
output path: C:\data | |
0. -search- to search for packages, -help COMMAND- to look up the manual of COMMAND where you can also find abbreviation. | |
1. Prepare data in excel which has id, year, y, x1, x2, x3 and region. | |
2. Take (natural) logarithm of y, x1, x2, x3. | |
3. Produce LaTeX tables of descriptive statistics with paranoiac syntax, before and after taking logarithm; using outreg2. | |
4. Produce plain text tables of correlation using mkcorr which doesn't support conditionals, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;-Caption | |
LWIN & LButton:: | |
WinSet, Style, -0xC00000, A | |
return | |
;+Caption | |
LWIN & RButton:: | |
WinSet, Style, +0xC00000, A | |
return |