Skip to content

Instantly share code, notes, and snippets.

View lopezjurip's full-sized avatar
🎯
Focusing

Patricio López Juri lopezjurip

🎯
Focusing
View GitHub Profile
@lopezjurip
lopezjurip / App.js
Last active March 22, 2018 18:48
styled-components ssr problems with bad usage
/* FOCUS IN THE PURPLE (COOL) <a /> component */
// GOOD ----------------------------------
const Container = styled("div")``;
const Link = styled("a")`
color: green;
`;
const LinkCool = styled(Link)`
color: purple;
`;
@lopezjurip
lopezjurip / lines.sh
Created January 10, 2018 21:12
Rails 5 - Create seed.rb file from production database in Heroku
# Download with Heroku CLI
heroku pg:backups:capture
heroku pg:backups:download
# Should create a dump file, let's name it 'latest.dump'
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d MY_APP_development latest.dump
# Install 'seed_dump' gem
bundle exec rake db:seed:dump EXCLUDE=encrypted_password,reset_password_token
import requests
url = 'https://chile.rutificador.com/'
client = requests.session()
client.get(url)
csrftoken = client.cookies['csrftoken']
url = url + 'get_generic_ajax/'
@lopezjurip
lopezjurip / index.js
Last active December 17, 2016 15:43
Detect semver release
const assert = require('assert');
function version(semver) {
const indexes = [
'major',
'minor',
'patch',
];
return semver.split('.').reduce((classification, number, index) => {
@lopezjurip
lopezjurip / README.md
Created December 16, 2016 21:08
macOS: Yarn + nvm with globals (bins) to $PATH

Yarn and nvm

  • Requisites: brew

Install nvm:

brew install nvm
'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 October 7, 2016 11:46
PintosOS with Docker (useful macOS)

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 September 25, 2016 02:08
Github full code review
# 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
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> {}
declare module "react-native-button" {
const value: any;
export default value;
}