This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'webrick' | |
include WEBrick | |
s = HTTPServer.new( | |
:Port => ARGV[0] || 8000, | |
:DocumentRoot => Dir::pwd | |
) | |
## mount subdirectories |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'webrick' | |
include WEBrick | |
s = HTTPServer.new( | |
:Port => ARGV[0] || 8000, | |
:DocumentRoot => Dir::pwd | |
) | |
## mount subdirectories |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Based on gmail-refreshest by @roycifer */ | |
/* @match mail.google.com */ | |
body, td, input, textarea, select {font-family:"Helvetica Neue",helvetica,arial,sans-serif;} | |
.gbeti#gb .gbqldr, .gbet#gbqlw .gbqldr, .gbesi#gb .gbqldr, .gbes#gbqlw .gbqldr{max-height:35px;margin-top:3px;} | |
.w-asZ .L3:hover, .w-asZ .L3:active, .gbqfb:hover, .gbqfb:active{background:#333;border-color:#000;} | |
.T-I-ax7, .T-I-KE, .ej .Bq{font-family:"Helvetica Neue",helvetica,arial,sans-serif;font-weight:normal;cursor:pointer} | |
.T-I-ax7:hover, .T-I-ax7:active, .T-I-KE:hover, .T-I-KE:active, .ej .Bq:hover, .ej .Bq:active{background:#e6e6e6 !important;box-shadow:0 0 2px #eee;} | |
.T-I .T-I-J3{margin-top:-5px;} | |
.Cq .T-I{margin-right:4px;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ACTIVATION_RESPONSE = 1 | |
NeuralNetwork = { | |
transfer = function( x) return 1 / (1 + math.exp(-x / ACTIVATION_RESPONSE)) end --This is the Transfer function (in this case a sigmoid) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Dispatcher = require('flux').Dispatcher; | |
/* | |
* Do not create helper methods such as "handleViewAction" unless you have a use case in your app | |
var AppDispatcher = new Dispatcher(); | |
AppDispatcher.handleViewAction = function(action) { | |
this.dispatch({ | |
source: 'VIEW_ACTION', | |
action: action | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create: function(text) { | |
// Instead of using the helper | |
// AppDispatcher.handleViewAction(...) | |
// Dispatch directly | |
AppDispatcher.dispatch({ | |
actionType: TodoConstants.TODO_CREATE, | |
text: text | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TodoStore = assign({}, EventEmitter.prototype, { | |
/* | |
* These aren't really necessary: | |
* | |
addChangeListener: function(callback) { | |
this.on(CHANGE_EVENT, callback); | |
}, | |
removeChangeListener: function(callback) { | |
this.removeListener(CHANGE_EVENT, callback); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentDidMount: function() { | |
// Instead of TodoStore.addChangeListener(this._onChange); | |
TodoStore.addListener(StoreConstants.CHANGE, this._onChange); | |
}, | |
componentWillUnmount: function() { | |
// Instead of TodoStore.removeChangeListener(this._onChange); | |
TodoStore.removeListener(StoreConstants.CHANGE,this._onChange); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var contacts = {}; | |
var handleAddContact = (action) => { | |
contacts.assign(contacts, action.contact); | |
ContactsStore.emitChange(); | |
} | |
var handleRemoveContact = (action) => { | |
var updatedContacts = state.contacts.filter((contact) => { | |
return contact.id !== action.contact.id; |
OlderNewer