Skip to content

Instantly share code, notes, and snippets.

View AlexxNica's full-sized avatar
🚀

Alexandre Nicastro AlexxNica

🚀
View GitHub Profile
@AlexxNica
AlexxNica / the-bind-problem.jsx
Created November 9, 2017 16:58 — forked from Restuta/the-bind-problem.jsx
React, removeEventListener and bind(this) gotcha
/* Sometimes it's pretty easy to run ito troubles with React ES6 components.
Consider the following code: */
class EventStub extends Component {
componentDidMount() {
window.addEventListener('resize', this.onResize.bind(this)); //notice .bind
}
componentWillUnmount() {
window.removeEventListener('resize', this.onResize.bind(this));
@AlexxNica
AlexxNica / rn-cli.config.js
Created October 15, 2017 19:54 — forked from ptmt/rn-cli.config.js
rn-cli.config.js
const path = require('path');
// Don't forget to everything listed here to `package.json`
// modulePathIgnorePatterns.
const sharedBlacklist = [
/node_modules[/\\]react[/\\]dist[/\\].*/,
'downstream/core/invariant.js',
/website\/node_modules\/.*/,
const MODULE_DIR = /(.*([\/\\]node_modules|\.\.)[\/\\](@[^\/\\]+[\/\\])?[^\/\\]+)([\/\\].*)?$/g;
{
loader: 'babel-loader',
test: /\.jsx?$/,
include(filepath) {
if (filepath.split(/[/\\]/).indexOf('node_modules')===-1) return true;
let pkg, manifest = path.resolve(filepath.replace(MODULE_DIR, '$1'), 'package.json');
try { pkg = JSON.parse(fs.readFileSync(manifest)); } catch (e) {}
return !!(pkg.module || pkg['jsnext:main']);
@AlexxNica
AlexxNica / Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Created October 7, 2017 08:31 — forked from IamAdiSri/Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Setting up and using Python3, Pip3, Virtualenv (for Python3) and Virtualenvwrapper (for Python3)
First install pip for Python2. Download the get-pip.py file from https://bootstrap.pypa.io/get-pip.py
$ cd <download location>
$ sudo -H ./get-pip.py
Use pip to install pip3
$ sudo -H pip install pip3
Installing pip3 also installs Python3
To run Python3
$ python3
@AlexxNica
AlexxNica / tools.md
Created June 13, 2017 20:03 — forked from nrc/tools.md
Rust tooling

Rust developer tools - status and strategy

Availability and quality of developer tools are an important factor in the success of a programming language. C/C++ has remained dominant in the systems space in part because of the huge number of tools tailored to these lanaguages. Succesful modern languages have had excellent tool support (Java in particular, Scala, Javascript, etc.). Finally, LLVM has been successful in part because it is much easier to extend than GCC. So far, Rust has done pretty well with developer tools, we have a compiler which produces good quality code in reasonable time, good support for debug symbols which lets us leverage C++/lanaguge agnostic tools such as debuggers, profilers, etc., there are also syntax highlighting, cross-reference, code completion, and documentation tools.

In this document I want to layout what Rust tools exist and where to find them, highlight opportunities for tool developement in the short and long term, and start a discussion about where to focus our time an

@AlexxNica
AlexxNica / README.md
Created May 29, 2017 09:50 — forked from watson/README.md
A list of search and replace unix commands to help make a node repository 'standard' compliant

The standard code style linter is a great tool by Feross - check it out!

Remove trailing semicolons:

find . -path ./node_modules -prune -o -type f -name '*.js' -exec sed -i '' -e 's/;$//' {} \;

Ensure space between function and opening bracket:

@AlexxNica
AlexxNica / !wasmllvm.md
Created May 27, 2017 17:55 — forked from yurydelendik/!wasmllvm.md
Using WebAssembly in LLVM

Using WebAssembly in LLVM

Compiling

# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR

# checkout LLVM
➜ pretty-format git:(perf) ✗ npm run perf
> [email protected] perf /Users/thejameskyle/Projects/pretty-format
> node perf/test.js
empty arguments:
prettyFormat() - 662ns - 0.066249041s total (100000 runs) - "Arguments []"
JSON.stringify() - 738ns - 0.073823264s total (100000 runs) - "{}"
util.inspect() - 55131ns - 5.513100926s total (100000 runs) - "{ [length]: 0,\n [callee]: \n { [Function: returnArguments]\n [length]: 0,\n [name]: 'returnArguments',\n [arguments]: null,\n [caller]: null,\n [prototype]: returnArguments { [constructor]: [Circular] } },\n [Symbol(Symbol.iterator)]: \n { [Function: values]\n [length]: 0,\n [name]: 'values',\n [prototype]: values { [constructor]: [Circular] } } }"
@AlexxNica
AlexxNica / 10-Bit H.264
Created May 19, 2017 10:52
10-Bit H.264 explanation
10-Bit H.264
For all those who haven’t heard of it already, here’s a quick rundown about the
newest trend in making our encodes unplayable on even more systems: So-called
high-bit-depth H.264. So, why another format, and what makes this stuff
different from what you know already?
First off: What is bit depth?
In short, bit depth is the level of precision that’s available for storing color
information. The encodes you’re used to have a precision of 8 bits (256 levels)
{ config, pkgs, ...}:
let
pixfix = if (builtins.currentSystem == "armv6l-linux") then
[ ./pixman.nix ]
else
[];
passwords = import ./passwords.nix;
keys = import ./keys.nix;
in