Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Patricio López Juri lopezjurip

🎯
Focusing
View GitHub Profile
@lopezjurip
lopezjurip / index.js
Last active Dec 17, 2016
Detect semver release
View index.js
const assert = require('assert');
function version(semver) {
const indexes = [
'major',
'minor',
'patch',
];
return semver.split('.').reduce((classification, number, index) => {
@lopezjurip
lopezjurip / README.md
Created Dec 16, 2016
macOS: Yarn + nvm with globals (bins) to $PATH
View README.md

Yarn and nvm

  • Requisites: brew

Install nvm:

brew install nvm
View shuffle.js
'use strict';
const _ = require('lodash');
const moment = require('moment');
const now = moment().hour(11).minute(30).second(0);
function group(number, name) {
return { number, name };
}
@lopezjurip
lopezjurip / README.md
Last active Oct 7, 2016
PintosOS with Docker (useful macOS)
View README.md

Make sure you have Docker up and running.

docker run --name=pintos -v /$(pwd):/home/OS -t -i ubuntu:16.04 /bin/bash

Inside the container run:

cd /home/OS
@lopezjurip
lopezjurip / script.sh
Created Sep 25, 2016
Github full code review
View script.sh
# Create empty branch.
git checkout --orphan review
git rm -rf .
git commit --allow-empty -m "Create empty branch"
git push --set-upstream origin review
# Create `project` branch from `master` current state.
git checkout -b project
git merge master --allow-unrelated-histories
git push --set-upstream origin project
View declarations.d.ts
declare module "react-native-button" {
import React, { Component } from "react";
interface Props {
style?: React.ViewStyle;
styleDisabled?: React.ViewStyle;
onPress?: () => any;
}
export default class Button extends Component<Props, any> {}
View declarations.d.ts
declare module "react-native-button" {
const value: any;
export default value;
}
View index.android.js
'use strict'
import { AppRegistry } from 'react-native'
import App from './build'
AppRegistry.registerComponent('ReactNativeTS', () => App)
View index.tsx
// src/index.ts
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View
} from 'react-native';
interface Props {
View tsconfig.json
{
"compilerOptions": {
"target": "es2015",
"module": "es2015",
"jsx": "react",
"outDir": "build",
"rootDir": "src",
"allowSyntheticDefaultImports": true,
"noImplicitAny": true,
"experimentalDecorators": true,