Skip to content

Instantly share code, notes, and snippets.

Marcos Ojeda nsfmc

View GitHub Profile
@nsfmc
nsfmc / index.js
Created Jul 12, 2018
super minimal server react setup
View index.js
import React from 'react';
import ReactDOMServer from 'react-dom/server';
import express from 'express'
const app = express();
app.get('/', (_, res) => {
console.log()
@nsfmc
nsfmc / index.js
Last active Apr 29, 2018
@nsfmc/babel-preset-sketching, a babel 7 preset for when i just want things to work the way i expect
View index.js
module.exports = function(api, opts) {
const prod = process.env.NODE_ENV === "production";
return {
presets: [
[
require("@babel/preset-env"),
{
targets: {
browsers: [">1%", "not ie 11"]
@nsfmc
nsfmc / chouch.js
Created Mar 7, 2018
a bad couch implementation
View chouch.js
const request = require('superagent');
class CouchClient {
constructor(db, host='http://localhost:5984') {
this.host = host;
this.db = db;
}
view(designDoc, viewName, opts = {}) {
View gist:80a08cec727bce28b1a74cf1b38cfde0
Verifying my Blockstack ID is secured with the address 12yroXUpFaXP4bL9wxw3LARRX8Be8HYZui https://explorer.blockstack.org/address/12yroXUpFaXP4bL9wxw3LARRX8Be8HYZui
View import_utils.js
// @flow
import {parse} from 'babylon';
const commonParser = (input: string) => parse(input, {
sourceType: 'module',
plugins: ['jsx', 'flow'],
});
const bodyParser = (input: string) => commonParser(input).program.body;
View training.md

Getting started

getting started using dynamic labels is as easy as 1 2 4! First copy the following text:

<first name> is a dynamic label for someone's <name>

@nsfmc
nsfmc / readme.md
Created Jan 25, 2017
returns the most common padding/margin values
View readme.md

assuming you got a list of margin/padding values from your css with

ack --css margin > margin.txt
ack --css padding > padding.txt

you can run

@nsfmc
nsfmc / git-music.sh
Last active Jan 25, 2017 — forked from mroth/git-music.sh
Adds the currently playing iTunes/Spotify track to your prepared git commit message.
View git-music.sh
#!/bin/bash
# Adds the currently playing iTunes track to your prepared commit message.
#
# To install, save in repo as chmod +x to .git/hooks/prepare-commit-msg
# save music.js somewhere like ~/.bin
# if you don't use a commit template $SONG should precede $1 to allow --verbose
# commits to work, otherwise change the echo to "$(cat $1)\n\n$SONG"
SONG=`osascript -l JavaScript ~/.bin/music.js`
if [[ $SONG ]]; then
echo -e "\n\n$SONG\n$(cat $1)" > $1
View bar.js
import typeof {Foo} from './foo'
class Bar extends Component {
props: {
foolike: Foo
}
render (){....}
}
@nsfmc
nsfmc / .babelrc
Last active Jul 22, 2016
`unstable_handleError` and `ReactDOMServer.renderToString` test case
View .babelrc
{
"presets": ["es2015", "react"]
}
You can’t perform that action at this time.