Skip to content

Instantly share code, notes, and snippets.

View kevzettler's full-sized avatar

kev zettler kevzettler

View GitHub Profile
@kevzettler
kevzettler / gist:11384188
Last active August 29, 2015 14:00
JS Assign
  • Look at the following code. What does it do? What happens if you click on the li elements?
  • Establish what happens when you click on the li elements. Why does this happen?.
  • how can the code can be fixed so that it has the expected behavior
<html>
  <body>
    <ul>
     <li>First</li>
 Second
@kevzettler
kevzettler / gist:6baf208a73f16a2974f5
Last active August 29, 2015 14:02
keeperll clang
nknown542696d2a12b:keeperrl kevzettler$ make -j 8 OPT=true
g++ -MMD -Wall -std=c++0x -stdlib=libc++ -static-libstdc++ -Wno-sign-compare -Wno-unused-variable -I /usr/local/Cellar/boost/1.55.0/include/boost/ -I. -I./extern -static-libstdc++ -g -O3 -c time_queue.cpp -o obj-opt/time_queue.o
g++ -MMD -Wall -std=c++0x -stdlib=libc++ -static-libstdc++ -Wno-sign-compare -Wno-unused-variable -I /usr/local/Cellar/boost/1.55.0/include/boost/ -I. -I./extern -static-libstdc++ -g -O3 -c level.cpp -o obj-opt/level.o
g++ -MMD -Wall -std=c++0x -stdlib=libc++ -static-libstdc++ -Wno-sign-compare -Wno-unused-variable -I /usr/local/Cellar/boost/1.55.0/include/boost/ -I. -I./extern -static-libstdc++ -g -O3 -c model.cpp -o obj-opt/model.o
g++ -MMD -Wall -std=c++0x -stdlib=libc++ -static-libstdc++ -Wno-sign-compare -Wno-unused-variable -I /usr/local/Cellar/boost/1.55.0/include/boost/ -I. -I./extern -static-libstdc++ -g -O3 -c square.cpp -o obj-opt/square.o
g++ -MMD -Wall -std=c++0x -stdlib=libc++ -static-libstdc++ -Wno-sign-compare
var q = async.queue(function (file, cb) {
console.log("from the queue::", file.path);
var stream = fs.createReadStream(file.path)
// ...
stream.on('end', function() {
// finish up, then
cb();
});
}, 2);
@kevzettler
kevzettler / javascript
Created October 30, 2014 21:09
newforms
/** @jsx React.DOM */
'use strict';
var React = require('react'),
Form = require('../Form'),
newforms = require('newforms');
var ProfileForm = newforms.Form.extend({
fname: newforms.CharField({
/** @jsx React.DOM */
'use strict';
var React = require('react'),
Label = require('./Label'),
TextField = require('./TextField');
var LabeledInput = React.createClass({
propTypes: {
label: React.PropTypes.string.isRequired,
@kevzettler
kevzettler / docpath.js
Created March 24, 2015 00:09
click track thing
var docpath = {};
docpath.queue = [];
docpath.current_event = 0;
docpath.playback = function(){
this.queue[current_event];
debugger;
this.current_event++;
var xhr = $.ajax({ url : "./"});
xhr._onreadystatechange = xhr.onreadystatechange;
xhr.onreadystatechange = function() {
xhr._onreadystatechange();
if (xhr.readyState == 3){alert('Interactive');}
};
@kevzettler
kevzettler / gist:846662
Created February 27, 2011 22:59
messy js
function crm(req,res,cb){
var post_body = "name="+encodeURIComponent(req.body.username)+"&password="+encodeURIComponent(req.body.password);
request({
method : "GET"
,uri: "http://admin:CREm@localhost.com/admin/login/login"
}, function(error, get_response, body){
jsdom.env(body, [
'http://code.jquery.com/jquery-1.5.min.js'
], function(errors, window) {
@kevzettler
kevzettler / gist:846663
Created February 27, 2011 23:00
manageable js
function crm(req,res,cb){
var post_body = "name="+encodeURIComponent(req.body.username)+"&password="+encodeURIComponent(req.body.password);
function getRequestParams(){
return {
method : "GET"
,uri: "http://admin:CREm@localhost.com/admin/login/login"
};
}
@kevzettler
kevzettler / gist:1331223
Created November 1, 2011 17:14
export_error
Started GET "/admin/current_site/edit" for 97.95.63.213 at 2011-11-01 17:12:38 +0000
Processing by Admin::CurrentSiteController#edit as HTML
[LocomotiveCMS] [fetch site] host = wandering-katana-74.bushi.do / wandering-katana-74.bushi.do
Rendered app/cells/admin/sub_menu/show.html.haml (2.8ms)
Rendered admin/current_site/_form.html.haml (128.4ms)
Rendered admin/shared/_form_actions.html.haml (3.3ms)
Rendered admin/shared/_head.html.haml (1.1ms)
Rendered app/cells/admin/global_actions/show.html.haml (0.8ms)
Rendered admin/shared/_header.html.haml (4.0ms)
Rendered app/cells/admin/main_menu/show.html.haml (1.0ms)