Skip to content

Instantly share code, notes, and snippets.

View jadeyslau's full-sized avatar
🍊

Jade Lau jadeyslau

🍊
View GitHub Profile
wget -r -np -k -nd -A pdf [website]
For downloading files from a directory listing, use -r (recursive), -np (don't follow links to parent directories), and -k to make links in downloaded HTML or CSS point to local files (credit @xaccrocheur).
wget -r -np -k http://www.ime.usp.br/~coelho/mac0122-2013/ep2/esqueleto/
Other useful options:
-nd (no directories): download all files to the current directory
-e robots.off: ignore robots.txt files, don't download robots.txt files
-A png,jpg: accept only files with the extensions png or jpg
@jadeyslau
jadeyslau / gist:2831e7a9ad295246a965456dfe3f01c2
Last active June 15, 2017 15:11
CMTK Registration command for MPC Ubuntu
For Ubuntu MPC
"/usr/lib/cmtk/bin/munger" -b "/usr/lib/cmtk/bin" -a -w -r 010203 -X 26 -C 8 -G 80 -R 4 -A '--accuracy 0.4' -W '--accuracy 0.4' -T 1 -s "refbrain/refbrain.nrrd" images
What the Randlett paper uses:
"/usr/local/lib/cmtk/bin/munger" -b "/usr/local/lib/cmtk/bin" -a -w -r 010203 -T 8 -X 52 -C 8 -G 80 -R 3 -A '--accuracy 0.4' -W '--accuracy 1.6' -s "refbrain/refbrain.nrrd" images
For OSX
1 core
background: linear-gradient(0deg, #b4e1d5, #93a1ce);
background-size: 400% 400%;
-webkit-animation: AnimationName 33s ease infinite;
-moz-animation: AnimationName 33s ease infinite;
-o-animation: AnimationName 33s ease infinite;
animation: AnimationName 33s ease infinite;
@-webkit-keyframes AnimationName {
0%{background-position:0% 71%}
50%{background-position:100% 30%}
100%{background-position:0% 71%}
@jadeyslau
jadeyslau / gist:7043676
Created October 18, 2013 15:57
Finds all package contents.
pkgutil --pkgs | grep mercurial
@jadeyslau
jadeyslau / index.html
Created August 15, 2013 12:05
A CodePen by Hakim El Hattab. Avgrund - A modal concept with a visible level of depth between the page and modal layers.
<article class="avgrund-contents">
<h1>Avgrund</h1>
<p>
A modal concept with a visible level of depth between the page and modal layers. Click a button below to give it a try.
</p>
<button onclick="avgrund.activate( 'stack' );">Stack it</button>
<button onclick="avgrund.activate();">Grow it</button>
<p>
Uses CSS transforms to scale components and CSS filters to blur the page.
</p>
@jadeyslau
jadeyslau / index.html
Created August 15, 2013 11:55
A CodePen by suffick. Tear-able Cloth - Javascript cloth simulation.
<canvas id = "c" > </canvas>
<a target="_blank" href="http://codepen.io/stuffit/pen/fhjvk" id="p">Like playing with physics? Click here!</a>
<div id="info">
<div id="top">
<a target="_blank" id="site" href="http://lonely-pixel.com">my website</a>
<a id="close" href="">close</a>
</div>
<p>
@jadeyslau
jadeyslau / Clear floats
Last active December 20, 2015 15:29
/* Clear class to clear above floats */
/* Clear class to clear above floats */
.clear {
clear: both !important;
float: none !important;
background: none !important;
padding: 0px !important;
margin: 0px !important;
height: 0;
width: 0;
}
@jadeyslau
jadeyslau / Meta contents.
Created July 2, 2013 16:02
Get Meta contents.
function getMetaContents(mn){
var m = document.getElementsByTagName('meta');
// console.log(m[);
for(var i in m){
console.log(m[i].attributes);
if(m[i].attributes[0].nodeValue == mn){
return m[i].content;
}
}
}
@jadeyslau
jadeyslau / FB scrollTo()
Created June 26, 2013 17:46
Scrolling within FB tab.
function scrollTo(y){
FB.Canvas.getPageInfo(function(pageInfo){
$({y: pageInfo.scrollTop}).animate(
{y: y},
{duration: 1000, step: function(offset){
FB.Canvas.scrollTo(0, offset);
}
});
});
}