Skip to content

Instantly share code, notes, and snippets.

View scottferg's full-sized avatar

Scott Ferguson scottferg

  • Numerator/InfoScout
  • Chicago, IL
View GitHub Profile
# build
sudo docker build -t pokerap .
# run
sudo docker run -v /dev/log:/dev/log pokerap /go/bin/gokerap
# check syslog
sudo tail /var/log/syslog
# here are the cool lines I like
package com.google.gwt.sample.stockwatcher.client;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.http.client.URL;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
{
"name": "Sizerator",
"version": "1.0",
"description": "The first extension that I made.",
"toolstrips": [
"my_toolstrip.html"
],
"permissions": [
"tabs"
],
// In your toolstrip JS onClick event
var port chrome.self.connect();
port.postMessage({array:of, some:elements});
// In your content-script
// Event handler that listens for responses from
// the extension
chrome.extension.onConnect().addListener(function(port) {
port.onMessage.addListener( function( data ) {
// Data is the response, resize your window here
var settings = {};
/**
* Event listener for when a user enters their username within
* the extension UI. Currently this only works when you're
* viewing forums.somethingawful.com since we don't have any
* events that can be fired on a localStorage event that occurs
* within the extension.
*
*/
{
"name": "Sizerator",
"version": "1.0",
"description": "The first extension that I made.",
"toolstrips": [
"my_toolstrip.html"
],
"permissions": [
"tabs"
],
// Copyright (c) 2009, William Best and Scott Ferguson
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
const int buttonPin = 2; // Number of the pushbutton pin
const int ledPin = 13; // Number of the LED pin
int buttonState = 0;
int lightOn = false;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
}
<html>
<head>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/toolstrip-handler.js"></script>
<link rel="stylesheet" type="text/css" href="css/toolstrip.css" />
</head>
<body>
<div class="toolstrip-content bookmarks">
Hello World
</div>
int speakerPin = 9;
int length = 15;
char notes[] = "ccggaagffeeddc ";
int beats[] = { 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 4 };
int tempo = 300;
void playTone(int tone, int duration) {
for (long i = 0; i < duration * 1000L; i += tone * 2) {
digitalWrite(speakerPin, HIGH);