Skip to content

Instantly share code, notes, and snippets.

View fakenickels's full-sized avatar
💭
hello this is a mic test, are you listening

Gabriel fakenickels

💭
hello this is a mic test, are you listening
View GitHub Profile
@fakenickels
fakenickels / concise_methods.sh
Last active January 19, 2016 22:59
ES5 to ES6 syntax snippets
# { fn:function(args){} } => { fn(args){} }
find . -name \*.js -exec perl -p -i -e 's/:\s?function\s?\((.+)?\)\s?/(\1)/' {} \;
import React from 'react';
import {
View,
Text,
TextInput,
TouchableHighlight,
} from 'react-native';
import Meteor from 'react-native-meteor';
import { Actions } from 'react-native-router-flux';
@fakenickels
fakenickels / proxyquire-example.js
Created May 10, 2016 18:15
Proxyquire example
// file a.js
import foo from 'foo';
export default () => foo.log(2);
// file a.test.js
import proxyquire from 'proxyquire';
import { spy } from 'sinon';
const foo = {
@fakenickels
fakenickels / containers-example.js
Last active May 22, 2017 15:30
containers-example
import React from 'react'
import UserContainer from '../some/where'
class Foo extends React.Component {
render(){
}
}
export default UserContainer(Foo)
@fakenickels
fakenickels / decorators-container-example.js
Last active September 27, 2016 19:06
decorators-container-example
import React from 'react';
import UserContainer from '../some/where';
import ItemsContainer from '../some/where/else'
// Yes, we can use more than one!
@UserContainer
@ItemsContainer
export default class Foo extends React.Component {
render(){}
}
addIndex () {
if [[ -f $1/index.js ]]; then
return 0;
fi
for file in `ls $1`; do
if [[ -d $1/$file ]]; then
echo "import './$file';" >> $1/index.js
addIndex $1/$file
else
@fakenickels
fakenickels / react-native-login-test-spec.js
Last active September 4, 2016 15:05
React Native test spec demo
import React from 'react';
import proxyquire from 'proxyquire';
import { shallow } from 'enzyme';
import { expect, assert } from 'chai';
import { stub } from 'sinon';
// This ensures that proxyquire won't run the file before we
// mock its imports.
const proxyquireStrict = proxyquire.noCallThru();
// Let's create our mocked version of the libraries
@fakenickels
fakenickels / stream-linux-pulse-audio-with-vlc-cli.sh
Last active July 1, 2016 01:15
Script to scream linux audio using VLC's CLI interface
pactl list | grep "Monitor Source" | sed 's/Monitor\ Source:\ /pulse:\/\//' | \xargs cvlc --sout '#transcode{acodec=mp3,ab=128,channels=2}:standard{access=http,dst=0.0.0.0:8888/pc.mp3}' -vvv --
@fakenickels
fakenickels / .babelrc
Created July 3, 2016 17:22
mocha runner
{
"presets": ["es2015"],
"plugins": ["syntax-flow", "transform-flow-strip-types", "syntax-object-rest-spread", "transform-object-rest-spread"]
}
@fakenickels
fakenickels / keybase.md
Created August 9, 2016 04:06
keybase.md

Keybase proof

I hereby claim:

  • I am grsabreu on github.
  • I am gabrielrubens (https://keybase.io/gabrielrubens) on keybase.
  • I have a public key whose fingerprint is F0B2 4634 455E AC4E F0A8 C8C9 595A 9856 28B4 03FC

To claim this, I am signing this object: