Skip to content

Instantly share code, notes, and snippets.

View vigosan's full-sized avatar
🏠
Working from home

Vicent Gozalbes vigosan

🏠
Working from home
View GitHub Profile
@vigosan
vigosan / gist:9357298
Last active August 29, 2015 13:57 — forked from fanktom/gist:1675562
# list
curl -v http://localhost:9292/api/v1/posts
# create
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"login":"foo","password":"bar"}' http://localhost:9292/api/v1/login
# read
curl -v http://localhost:9292/api/v1/posts/1.json
# update
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
@vigosan
vigosan / rails http status codes
Created October 7, 2015 07:21 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@vigosan
vigosan / simple_authentication.rb
Created May 26, 2016 05:51 — forked from tomdalling/simple_authentication.rb
A simple Sinatra app that demonstrates basic authentication
#!/user/bin/env ruby
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'sinatra', '~> 1.4'
gem 'bcrypt', '~> 3.1'
end
require 'sinatra/base'
@vigosan
vigosan / navigation.js
Created August 28, 2016 07:07 — forked from dmeents/navigation.js
The complete source code for the Creating a collapsible navigation menu in react
import React, { Component } from 'react';
import { Link } from 'react-router';
import classNames from 'classnames';
import MobileNav from 'react-icons/lib/io/navicon-round';
//navigation display
export default class NavContainer extends Component {
constructor(props) {
super(props);
this.state = {
@vigosan
vigosan / webpack.config.js
Created August 31, 2016 18:58 — forked from xpepermint/webpack.config.js
Webpack Common Configuration File (ReactJS)
'use strict';
/**
* Webpack Configuration File
*
* This is a configuration file for Webpack module bundler. You should customize
* it to fit your project.
*
* To start the development server run:
*
@vigosan
vigosan / ultimate-ut-cheat-sheet.md
Created November 6, 2016 16:35 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@vigosan
vigosan / dockercleanup.sh
Created January 10, 2017 19:35 — forked from toke/dockercleanup.sh
Remove old docker containers and images
# Remove old docker containers
docker rm $(docker ps --no-trunc -aq)
# Remove unreferenced images
docker images | grep "<none>" | awk '{print $3}' | xargs docker rmi
#OR
#alias dockercleancontainers="docker ps -a -notrunc| grep 'Exit' | awk '{print \$1}' | xargs -L 1 -r docker rm"
// In v2/3 you did this:
import ReactDOM from 'react-dom'
import { Router, browserHistory, Route } from 'react-router'
ReactDOM.render(
<Router>
<Route path="/about" component={About}/>
<Route path="/:username" component={User}/>
</Router>
)