Skip to content

Instantly share code, notes, and snippets.

View fourcolors's full-sized avatar
🎯
Perkisizing

fourcolors fourcolors

🎯
Perkisizing
View GitHub Profile
@fourcolors
fourcolors / todo.html
Created June 27, 2014 06:17
Todo List Application
<html>
<head>
<script src="react.js"></script>
<script src="transformer.js"></script>
</head>
<body>
<div id="component"></div>
<script type="text/jsx">
/** @jsx React.DOM */
@fourcolors
fourcolors / todo.html
Created June 27, 2014 06:43
ReactJS Breaking with No Div
<!DOCTYPE html>
<html>
<head>
<script src="react.js"></script>
<script src="transformer.js"></script>
</head>
<body>
<div id="component"></div>
<script type="text/jsx">
/** @jsx React.DOM */
@fourcolors
fourcolors / todo.html
Created June 27, 2014 21:07
ToDoList ReactJS
<!DOCTYPE html>
<html>
<head>
<script src="react.js"></script>
<script src="transformer.js"></script>
</head>
<body>
<div id="component"></div>
<script type="text/jsx">
/** @jsx React.DOM */
@fourcolors
fourcolors / index.html
Created June 28, 2014 00:52
Finished ToDoList in React
<!DOCTYPE html>
<html>
<head>
<script src="http://fb.me/react-0.10.0.js"></script>
<script src="http://fb.me/JSXTransformer-0.10.0.js"></script>
</head>
<body>
<div id="component"></div>
<script type="text/jsx">
/** @jsx React.DOM */
@fourcolors
fourcolors / gist:3977606705cc02553953
Created November 21, 2014 18:07
Sterling's Vimrc
"" ----------------------------------------------------------------------------
"" Random other items
"" ----------------------------------------------------------------------------
" Custom ignore for ctrl-p
let g:ctrlp_custom_ignore = '\v[\/]\.(DS_Storegit|hg|svn|optimized|compiled|node_modules)$'
"let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
" Ignore html in syntastic since it doesn't handle handlebars
let syntastic_mode_map = { 'passive_filetypes': ['html'] }
<%= form_tag registration_index_path do %>
<%= fields_for User.new do |u| %>
<%= u.label :phone %>
<%= u.text_field :phone %>
<% end %>
<p>
<%= label_tag :workout %>
<%= check_box_tag :workout %>
</p>
<p>
@fourcolors
fourcolors / Error message
Created January 12, 2012 06:50
Problem with asset pipeline
## Error
couldn't find file 'bootstrap-dropdown'
(in /Users/node/Projects/samplator/app/assets/javascripts/application.js:9)
sprockets (2.0.3) lib/sprockets/context.rb:100:in `resolve'
sprockets (2.0.3) lib/sprockets/context.rb:140:in `require_asset'
sprockets (2.0.3) lib/sprockets/directive_processor.rb:214:in `process_require_directive'
sprockets (2.0.3) lib/sprockets/directive_processor.rb:164:in `block in process_directives'
sprockets (2.0.3) lib/sprockets/directive_processor.rb:162:in `each'
@fourcolors
fourcolors / gist:4050235
Created November 10, 2012 06:55
Backbone model override
# Method Summary
# Before a request gets sent out we need to make sure
# it's formatted correctly and contains the right
# info. We are adding the CSRF tokens in the header
# so our POST request work and making sure any
# namespaced attributes are working so the server is
# happy. If we are using other AJAX request to post
# date we will have to add something for jQuery.
preProcessSync: ->
# Fix backbone headers
# Extends Backbone.View on top of itself with some added features
# we use regularly
class Backbone.View extends Backbone.View
##
# Manages child views and renders them whenever the parent view is rendered.
# Specify views as key:value pairs of `className: view` where `className` is
# a CSS className to find the element in which to to append a rendered
# `view.el`
#
@fourcolors
fourcolors / JavascriptModuleFunction.js
Last active December 14, 2015 00:29
Creating some examples for my bog.
(function(){
console.log("Module scoped function");
})();