In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:
- You can separate the code into different repositories.
perl: /[^u4E00-u9FA5]/ | |
js: match(/[\u4E00-\u9FA5]/) | |
Example: | |
use `<([^u4E00-u9FA5]*<[^u4E00-u9FA5]+>[^u4E00-u9FA5]*)*>` to match `<封爵 河津亭侯→安國鄉侯→向鄉侯→舞陽侯→晉王<追尊>→晉帝<追尊>>` |
Go to github | |
Create new repository [don't need to initialize with the readme (can add later)] | |
Go to R Studio | |
File -> New Project -> Version Control -> Git | |
Ctrl+V repository URL from GitHub | |
File -> New -> Markdown, enter Title, etc. | |
In the Markdown window, change "output=html_document" to "output=github_document" | |
Knit the document for the first time, will prompt you to save | |
Save as Title.rmd | |
In the "git" tab of the R studio Environment window, you will notice that the knit produced: |
brew list --formula | xargs -n1 -P8 -I {} \ | |
sh -c "brew info {} | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/{} \1/'" | \ | |
sort -h -r -k2 - | column -t |
URL=https://feeds.buzzsprout.com/136050.rss # A URL example | |
curl -s $URL | xmlstarlet sel -N atom="http://www.w3.org/2005/Atom" -t -m './/enclosure' -v '@url' -n | xargs -n 1 -P 10 wget -nc |
# [Example] mv 818210-021-english-vocabulary-devious-devout.mp3?blob_id=1265211 021-english-vocabulary-devious-devout.mp3 | |
# [Perl switches] https://perl101.org/command-line-switches.html | |
# Use "chomp" to remove '\n' from "$_". See https://perldoc.perl.org/functions/chomp | |
ls | perl -pe 'chomp;s/^\d+-(\d{3}-.*\.mp3)\?.*$/mv $_ $1 \n/' | sh |
'use strict' | |
function Scope() { | |
this.va = '123'; | |
}; | |
Scope.prototype.va = 'abc'; | |
var s = new Scope(); |
# toggle iTerm Dock icon | |
# add this to your .bash_profile or .zshrc | |
function toggleiTerm() { | |
pb='/usr/libexec/PlistBuddy' | |
iTerm='/Applications/iTerm.app/Contents/Info.plist' | |
echo "Do you wish to hide iTerm in Dock?" | |
select ync in "Hide" "Show" "Cancel"; do | |
case $ync in | |
'Hide' ) |
script(src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-2.2.1.min.js") |
var newText = $( "p" ).text().split( " " ).join( "</span> <span>" ); | |
newText = "<span>" + newText + "</span>"; | |
$( "p" ) | |
.html( newText ) | |
.find( "span" ) | |
.hover(function() { | |
$( this ).addClass( "hilite" ); | |
}, function() { | |
$( this ).removeClass( "hilite" ); |