Skip to content

Instantly share code, notes, and snippets.

View carnar's full-sized avatar

Carlos Narez carnar

View GitHub Profile
from flask import Flask
from flask_restful import Api, Resource, reqparse
app = Flask(__name__)
api = Api(app)
users = [
{
"name": "Nicholas",
"age": 42,
@carnar
carnar / mysql-users-57.txt
Created June 7, 2018 20:04
Create users in MySQL 5.7
CREATE USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT ALL ON database_name.* TO 'user'@'localhost';
FLUSH PRIVILEGES;
@carnar
carnar / happy_git_on_osx.md
Last active September 4, 2015 16:23 — forked from trey/happy_git_on_osx.md
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@carnar
carnar / gist:d9cd7b17b575c5222211
Last active June 18, 2018 12:49
How to open spotify urls in native application instead of Google Chrome

How to open spotify urls in native application instead of Google Chrome

Problem

When you open a Spotify URL in linux Google Chrome, this launches spotify web player instead of native application.

Solution

  1. Install Switcheroo Redirector extension for Google Chrome and create next routes.
@carnar
carnar / Gulpfile.js
Last active August 29, 2015 14:06 — forked from laracasts/Gulpfile.js
var gulp = require('gulp');
var phpspec = require('gulp-phpspec');
var run = require('gulp-run');
var notify = require('gulp-notify');
gulp.task('test', function() {
gulp.src('spec/**/*.php')
.pipe(run('clear').exec())
.pipe(phpspec('', { notify: true }))
.on('error', notify.onError({
@carnar
carnar / gist:354cf7fbe22f23fdd06f
Last active October 7, 2015 12:02
Git Prompt
# 1. Download https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
# 2. Copy this file to somewhere (e.g. ~/.git-prompt.sh).
# 3. Add the following lines to your ~/.bash_profile, ~/.bashrc or ~/.zshrc:
source ~/.git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
PS1='\W$(__git_ps1 " (\e[1;36m%s\e[0m)") \$ '