Skip to content

Instantly share code, notes, and snippets.

View brunoguerra's full-sized avatar
🌌
Growing online businesses 🥇

Bruno Guerra brunoguerra

🌌
Growing online businesses 🥇
  • Blumenau, SC
View GitHub Profile
#!/bin/bash
rm -rf dist && mkdir dist
npx babel src --out-dir dist --ignore node_modules
cp src/package.json dist
cd dist && yarn install --production --modules-folder node_modules
@sibelius
sibelius / Example.js
Last active April 23, 2018 23:44
Formik TextInput example
class ExampleForm extends React.Component<Props> {
render() {
return (
<View>
<TextInput name={'email'} />
</View>
);
}
}
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active May 10, 2024 14:19
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

[based on a true story]

So. Your friend's about to teach you how to make a website. Great!

You make a file, and you save it as 'index.html'. Why it's called 'index' isn't really explained to you, but whatever.

You type the following.

hello world
@tjwebb
tjwebb / load_history.js
Created March 19, 2016 07:01
Create a Node REPL with History
const repl = require(‘repl’)
const server = repl.start({ /* your config options */ })
// synchronous methods are fine, here. you don't want to run a REPL on any middleware that
// handles user requests, anyway.
fs.statSync('.node_repl_history')
// load command history from a file called .node_repl history in the current directory
fs.readFileSync('.node_repl_history')
.split(‘\n’)
@mikberg
mikberg / mockRelay.js
Created January 19, 2016 22:28
Relay mock module
import Relay from 'real-react-relay';
export class Mutation extends Relay.Mutation {
_resolveProps(props) {
this.props = props;
}
}
export class MockStore {
reset() {
@garycrawford
garycrawford / docker-compose.yml
Created July 9, 2015 13:00
MongoDB Replica Set docker-compose.yml
primary:
image: mongo:3.0
volumes:
- ./p:/data
ports:
- "27017:27017"
# Our current version of docker-compose doesn't allow extra_hosts which would be the best way
# to add curcular dependency container links in this case. We cant upgrade docker-compose
# without upgrading docker to 1.7, and we can't do that without upgrading the kernel on our
# CentOS VM's. As such we are using the hostname hask below to allow primary and secondary
@mike-north
mike-north / MaterializeCSS Multi-Column Card Flow.markdown
Created July 6, 2015 18:33
MaterializeCSS Multi-Column Card Flow
@schempy
schempy / stream-file-upload-s3-nodejs.js
Last active March 11, 2024 10:20
Streaming File Uploads To Amazon S3 With Node.js
var http = require('http');
var router = require('routes')();
var Busboy = require('busboy');
var AWS = require('aws-sdk');
var inspect = require('util').inspect;
var port = 5000;
// Define s3-upload-stream with S3 credentials.
var s3Stream = require('s3-upload-stream')(new AWS.S3({
accessKeyId: '',
@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences