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 / 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 / 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 / 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 / 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
# 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 / 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