Skip to content

Instantly share code, notes, and snippets.

@erwan
erwan / background.html
Created August 31, 2010 13:28
Chrome Screencast 1
<script>
</script>
@erwan
erwan / background.html
Created August 31, 2010 13:31
Chrome Screencast 2
<script>
// Global variable accessed by the popup
var telList;
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
telList = request["phones"];
chrome.pageAction.show(sender.tab.id);
sendResponse({});
});
@erwan
erwan / app.yaml
Created January 20, 2011 10:50
Jabber GAE Bot Screencast
application: thebabelfishbot
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: bot.py
inbound_services:
@erwan
erwan / main.js
Created January 23, 2012 20:03
CommonJS in Play Framework
var Person = require("person").Person;
var alan = new Person("Alan Turing", 30);
alert(alan.hello());
if (typeof $ === "undefined") {
var $ = {
ajax(url, params) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if(xhr.readyState < 4) {
return;
@erwan
erwan / Application.scala
Last active December 12, 2015 01:38
A small helper to use Slick within Play 2.1
package controllers
import play.api._
import play.api.mvc._
import play.api.Play.current
import models._
import AppDB.simple._
package controllers;
import play.*;
import play.mvc.*;
import play.libs.WS;
import play.libs.F.*;
import views.html.*;
public class Application extends Controller {
package com.mopub.mobileads;
import android.content.Context;
import android.util.Log;
import com.appbrain.AppBrainBanner;
import com.appbrain.BannerListener;
import java.util.Map;
public class AppbrainAppliftAdapter extends CustomEventBanner implements BannerListener {
Send: 0x0d 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Send: 0x0d 0x00 0x00 0x01 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Recv: 0x0d 0x01 0x00 0x01 0x02 0x53 0x47 0x00 0x0c 0x2f 0x01 0x01 0x00 0x00
Recv: 0x0a 0x52 0x01 0x00 0xa4 0x01 0x00 0xa5 0x37 0x00 0x79
Sensor Temp = 16.50
Sensor Hum = 55.00
Device id = a4:01
Recv: 0x0a 0x52 0x01 0x01 0x35 0x04 0x00 0xa7 0x37 0x00 0x79
Sensor Temp = 16.70
Sensor Hum = 55.00
Prismic.Api('https://lesbonneschoses.prismic.io/api', function (err, Api) {
// You can use the Api object inside this block
console.log("References: ", Api.data.refs);
});