Skip to content

Instantly share code, notes, and snippets.

@rust-play
rust-play / playground.rs
Created Nov 1, 2019
Code shared from the Rust Playground
View playground.rs
use ndarray::{array, Axis};
use std::mem;
fn main() {
let mut a = array!([0, 1, 2], [3, 4, 5], [6, 7, 8]);
let mut g = vec![9, 10, 11];
for mut c in a.axis_chunks_iter_mut(Axis(0), 1).into_iter().rev() {
for (x, y) in c.iter_mut().zip(g.iter_mut()) {
mem::swap(x, y);
}
View read_nonblock_fd.md
#!/usr/bin/env python
from __future__ import print_function
import os,fcntl

chunksize = 1024

rd, wr = os.pipe()

fl=fcntl.fcntl(rd,fcntl.F_GETFL,0)
@rust-play
rust-play / playground.rs
Created Nov 1, 2019
Code shared from the Rust Playground
View playground.rs
use std::rc::Rc;
#[derive(Clone)]
struct Foo;
struct Bar (Rc<Foo>);
struct FooBar {
_foo: Rc<Foo>,
_bar: Bar,
}
View Fn_13.js
(function (a, b, c) {
let sum = a + b + c;
console.log('La suma de a + b + c =', sum); // output La suma de a + b + c = 6
}(1, 2, 3));
@stysmmaker
stysmmaker / youtube-override-volume-normalization.js
Created Nov 1, 2019
Userscript to override YouTube volume normalization
View youtube-override-volume-normalization.js
// ==UserScript==
// @name YouTube - Override Volume Normalization
// @namespace https://mmaker.pw
// @version 0.3
// @description Override YouTube volume normalization
// @author MMaker
// @match *://www.youtube.com/*
// @grant none
// @run-at document-end
// ==/UserScript==
View vscode_shortcuts.md

VSCode Shortcuts

List of helpful shortcuts for faster coding

Official List of all commands

Open/View

View Fn_12.js
(function () {
console.log('Yo soy una función sin nombre y me ejecuto automáticamente');
}());
View Fn_11.js
function foo(a, b, bar) {
return bar(a, b);
}
function add(a, b) {
//...
}
foo(2, 3, add);
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@xxcef
xxcef / TORONTO_PART3.ipynb
Created Nov 1, 2019
Created on Cognitive Class Labs
View TORONTO_PART3.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.