Skip to content

Instantly share code, notes, and snippets.

View kyleondata's full-sized avatar

Kyle Jennings kyleondata

View GitHub Profile
local count = 0
core.register_service("auth", "http", function (applet)
count = count + 1
-- Get X-Auth-Token --
local token = applet.headers['x-auth-token'][0]
local cmd = 'curl -H "X-Auth-Token:'..token..'"'
cmd = cmd..' -sL -w "%{http_code}\\n"'
cmd = cmd..' "https://staging.identity-internal.api.rackspacecloud.com/v2.0/tokens/'..token..'"'
cmd = cmd..' -o /dev/null'
@app.route("/home")
or
@app.route("/home/")
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()
@kyleondata
kyleondata / ThoraxDemo.html
Last active December 14, 2015 16:59
Thorax JS Demo
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
</head>
<body>
</body>
</html>
@kyleondata
kyleondata / triangles.html
Created December 17, 2012 22:28
CSS Triangles
<html>
<head>
<style>
body{
background-color: #eee;
}
.triForce {
height: 50px;
/* gets any input that is type submit */
input[type='submit']{}
/* gets the first child of an element */
table:first-child{}
/* gets the second element that comes after the first,
in this example any hr tags that follow a div tag */
div + hr{}
@kyleondata
kyleondata / gist:3789104
Created September 26, 2012 16:43
Sprite Example
.desktopIcon
{
background-position: 0 0;
height: 25px;
width: 25px;
background-repeat: no-repeat;
}
@kyleondata
kyleondata / gist:3489548
Created August 27, 2012 15:32
Backbone.js events
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="jquery-1.7.2.min.js" ></script>
<script src="handlebars-1.0.0.beta.6.js" ></script>
<script src="underscore-min.js" ></script>
<script src="backbone-min.js" ></script>
@kyleondata
kyleondata / gist:3440492
Last active February 1, 2023 19:23
Backbone.js and Handlebars.js example
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />
<script src="jquery-1.7.2.min.js" ></script>
<script src="handlebars-1.0.0.beta.6.js" ></script>
<script src="underscore-min.js" ></script>
<script src="backbone-min.js" ></script>
@kyleondata
kyleondata / ApiHandler.rb
Created August 20, 2012 14:53
Sinatra example
require 'sinatra'
require 'json'
get '/api/hello' do
# Return this message in JSON format.
content_type :json
{ :message => 'Hello World!' }.to_json
end