Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Patricio López Juri lopezjurip

🎯
Focusing
View GitHub Profile
@lopezjurip
lopezjurip / css.json
Created May 22, 2020
Flexbox snippet for VSCode. Setup this on the CSS lang so it is available in styled-components etc.
View css.json
{
"Setup basic flexbox styling": {
"prefix": "flex",
"body": [
"display: flex;",
"flex-direction: ${1:column};",
"justify-content: ${2:flex-start};",
"align-items: ${3:flex-start};",
"$0"
],
View apollo-quick-client.js
import { ApolloClient } from "apollo-boost";
import { setContext } from "apollo-link-context";
import { InMemoryCache } from "apollo-cache-inmemory";
export default class APIClient {
constructor(context = {}, options = {}) {
this.context = context;
this.options = { fetchPolicy: "no-cache", ...options };
const authLink = setContext((_, context) => {
return {
@lopezjurip
lopezjurip / README.md
Last active Feb 11, 2020
Write to NTFS on OSX Yosemite and El Capitan
View README.md

OUTDATED, see comments below

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Update Homebrew formulae:

brew update
View hi.js
console.log("Hello world!");
@lopezjurip
lopezjurip / README.md
Created Sep 26, 2015
OSX Homebrew: docker-machine setup
View README.md

Prerequisites

Make sure you have installed Homebrew and (Homebrew-Cask)[http://caskroom.io/].

# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install Homebrew-cask
brew install caskroom/cask/brew-cask
@lopezjurip
lopezjurip / Cpp.sublime-build
Last active Jun 11, 2018
Sublime Text 3 - C++ Compile and run (OSX)
View Cpp.sublime-build
{
"cmd": ["g++ $file -o $file_base_name -I/usr/local/include ; ./$file_base_name"],
"selector": "source.c++",
"shell": true
}
@lopezjurip
lopezjurip / pythongitdepth.py
Created Oct 21, 2015
GitPython clone with depth
View pythongitdepth.py
import git
def clone(cls, directory, url, depth=3):
return git.Repo.clone_from(url, directory, depth=depth)
@lopezjurip
lopezjurip / App.js
Last active Mar 22, 2018
styled-components ssr problems with bad usage
View App.js
/* 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 Jan 10, 2018
Rails 5 - Create seed.rb file from production database in Heroku
View lines.sh
# 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
@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