Skip to content

Instantly share code, notes, and snippets.

View copy-large-dirs-fullpath.ps1
C:\Windows\System32\Robocopy.exe /E /R:3 /W:10 /FP /MT:25 /V "<SOURCE_DIRECTORY>" "<TARGET_DIRECTORY>"
View ls-by-modified-tail.ps1
ls | Sort-Object LastWriteTime | select -last 10
View copy-large-dirs.ps1
Robocopy.exe /E /R:3 /W:10 /FP /MT:25 /V "<SOURCE_DIRECTORY>" "<TARGET_DIRECTORY>"
@chamakits
chamakits / sample-stimulus.js
Created Feb 22, 2020
StimulusJS Adding Elements Dynamically
View sample-stimulus.js
class AutocompleteController extends Stimulus.Controller {
static get targets() {
return [ "results" ]
}
initialize() {
this.fakeFetch()
setInterval(this.fakeFetch.bind(this), 1500)
}
View humble-bundle-direct-download-staggered.js
javascript: function runDownloadThing(howManyToDownload) {
if (!howManyToDownload) {
howManyToDownload = 3;
}
if (window['downloadSome']) {
window.downloadSome();
return;
}
var iter = $('div.download a.a:not([download])').toArray();
iter = iter.concat($('div.row a[download]').toArray());
@chamakits
chamakits / weird_borrowing_error.rs
Last active Jun 24, 2016 — forked from anonymous/playground.rs
Problemataic borrowing
View weird_borrowing_error.rs
struct NoLifetime {}
struct WithLifetime <'a> {
pub field: &'a i32
}
fn main() {
let mut some_val = NoLifetime{};
borrow_mut_function(&mut some_val);
borrow_mut_function(&mut some_val);//Borrowing as mutable for the second time.
let num = 5;
@chamakits
chamakits / playground.rs
Created Jun 24, 2016 — forked from anonymous/playground.rs
Shared via Rust Playground
View playground.rs
struct StructNoLifetime {}
impl StructNoLifetime {
pub fn do_nothing(&mut self) {
}
}
struct StructWithLifetime <'a> {
pub field: &'a i32
}
fn main() {
@chamakits
chamakits / hello_rust1-1_prints.rs
Last active Jun 14, 2016 — forked from anonymous/playground.rs
Shared via Rust Playground
View hello_rust1-1_prints.rs
fn main() {
println!("Hello everyone!");
println!(r#"First line!
We are here to learn about the language "{}",
a really neat language."#,
"Rust");
println!("Multiline.\
Ignores leading whitespace and newline");
}
View rust-force-tests.rs
macro_rules! assign_do_nothing {
( $( $x:expr ),* ) => {
{
$(
let _curr = $x;
)*
}
};
}
You can’t perform that action at this time.