Skip to content

Instantly share code, notes, and snippets.

View petrbela's full-sized avatar

Petr Bela petrbela

View GitHub Profile

Usage

  1. npm install babel-loader imports-loader webpack --save
  2. Create webpack.config.js
  3. Move index.ios.js to src/index.ios.jsx
  4. webpack --watch

Example

src/index.ios.jsx

@staltz
staltz / introrx.md
Last active May 24, 2024 07:56
The introduction to Reactive Programming you've been missing
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@lukas-vlcek
lukas-vlcek / gist:5143799
Last active February 7, 2023 21:50
Adding a new analyzer into existing index in Elasticsearch (requires close/open the index). Tested with Elasticsearch 0.19.12.
// create an index with an analyzer "myindex"
curl -X PUT localhost:9200/myindex -d '
{
"settings" : {`
"index":{
"number_of_replicas":0,
"number_of_shards":1,
"analysis":{
"analyzer":{
"first":{
@alexeygolev
alexeygolev / controllersSpec.js
Created August 14, 2012 01:47
angular.js jasmine test spec for controller defined inside a module
'use strict';
/* jasmine specs for controllers go here */
describe('PhoneCat controllers', function() {
describe('PhoneListCtrl', function() {
beforeEach(module('phonesCat.controllers'));
@jwo
jwo / registrations_controller.rb
Created September 30, 2011 23:11
API JSON authentication with Devise
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else
@a-chernykh
a-chernykh / application_controller.rb
Created June 22, 2011 19:43
devise force https for sign in and sign up routes
class ApplicationController < ActionController::Base
before_filter :ensure_proper_protocol
protected
def ssl_allowed_action?
(params[:controller] == 'users/sessions' && ['new', 'create'].include?(params[:action])) ||
(params[:controller] == 'users/registrations' && ['new', 'create', 'edit', 'update'].include?(params[:action])) ||
(params[:controller] == 'users/omniauth_callbacks')
end