Skip to content

Instantly share code, notes, and snippets.

@stammy
stammy / food sites people linked me to on twitter
Created January 5, 2010 04:07
food sites people linked me to on twitter
http://twitter.com/Stammy/status/7389918542
http://cooktobang.com/
http://www.cookingforengineers.com/
http://www.bbc.co.uk/food
http://www.ehow.com/how_5800287_quit-eating-junk-food.html
http://www.betterthancereal.com/index.html
http://www.nursingschoolsearch.com/blog/2008/07/100-food-blogs-to-inspire-your-healthy-eating/
http://justbento.com/
http://justhungry.com/
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# - a browser with WebSocket support
#
# Usage:
# ruby redis_pubsub_demo.rb
#
service :notifo do |data, payload|
subscribe_url = URI.parse('https://api.notifo.com/v1/subscribe_user')
data['subscribers'].gsub(/\s/, '').split(',').each do |subscriber|
req = Net::HTTP::Post.new(subscribe_url.path)
req.basic_auth('github', secrets['notifo']['apikey'])
req.set_form_data('username' => subscriber)
net = Net::HTTP.new(subscribe_url.host, 443)
net.use_ssl = true
net.verify_mode = OpenSSL::SSL::VERIFY_NONE
@stammy
stammy / Notifo JS example: Send message to user from their own user account.js
Created June 16, 2010 07:17
Notifo JS example: Send message to user from their own user account
function sendNotifo(msg,title,uri,label) {
var https = new XMLHttpRequest();
var auth = "Basic " + Base64.encode(localStorage.notifo_username+':'+localStorage.notifo_apisecret);
var push = 'to=' + encodeURIComponent(localStorage.notifo_username) + '&msg=' + encodeURIComponent(msg) + '&uri=' + encodeURIComponent(uri) + '&label=' + encodeURIComponent(label)+ '&title=' + encodeURIComponent(title);
https.open('POST', 'https://api.notifo.com/v1/send_notification', true);
https.setRequestHeader('Authorization', auth);
https.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
https.send(push);
}
@stammy
stammy / WP-Notifo-notifo_message.php
Created June 16, 2010 07:42
WP-Notifo notifo_message()
<?php
function notifo_message($title,$msg,$uri = false,$to = false)
{
$notifo_pass = get_option('notifo_api_key');
$notifo_user = get_option('notifo_username');
$data = array('label' => get_bloginfo('name'), 'title' => $title, 'msg' => $msg);
if($uri)
{
.box-gradient {
background-image: -moz-linear-gradient(top, #444444, #999999);
background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #444444),color-stop(1, #999999));
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444444', endColorstr='#999999');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#444444', endColorstr='#999999')";
}
.ff2 .box-gradient, .ff3 .box-gradient, .opera .box-gradient {
background-image: url("../images/gradient.svg");
}
div#columns
div.tri
width: 29.5%
margin-right: 25px
padding: 5px
float: left
&:last-child
margin-right: 0
h5
border-bottom: 1px solid #e5e5e5
function sendNotifo(label,msg,uri) {
var https = new XMLHttpRequest();
var creds = localStorage.getItem("notifo");
var auth = "Basic " + Base64.encode(creds);
var push = 'to=' + encodeURIComponent(creds[0]) + '&msg=' + encodeURIComponent(msg) + '&uri=' + encodeURIComponent(uri) + '&label=' + encodeURIComponent(label) + '&title=' + encodeURIComponent("Page");
https.onreadystatechange = function() {
if (this.readyState == 4)
switch (https.status) {
case 200:
document.getElementById('message').innerHTML = "<strong>Success</strong>: Your Notifo username and API key are valid.";
# PROBLEM: when someone replies to you publicly in an IRC channel you may not be
# notified of it if you are away from your computer. The common format for public
# replies looks like this:
#
# <jchris> maxo_: yeah mine is way better
#
# SOLUTION: Sign up for notifo as both a supplier and a consumer, and install the
# notifo app on your smartphone. Execute this in cron every minute to have new
# mentions sent to your phone as push notifications.
#
[53686] 23 Sep 14:20:55 - DB 4: 272 keys (0 volatile) in 512 slots HT.
[53686] 23 Sep 14:20:55 - DB 5: 15081 keys (0 volatile) in 16384 slots HT.
[53686] 23 Sep 14:20:55 - DB 6: 1817 keys (0 volatile) in 2048 slots HT.
[53686] 23 Sep 14:20:55 - DB 7: 2 keys (0 volatile) in 4 slots HT.
[53686] 23 Sep 14:20:55 - DB 8: 935586 keys (0 volatile) in 1048576 slots HT.
[53686] 23 Sep 14:20:55 - DB 9: 5008 keys (0 volatile) in 8192 slots HT.
[53686] 23 Sep 14:20:55 - 0 clients connected (0 slaves), 176879488 bytes in use
[53686] 23 Sep 14:21:00 - DB 0: 10289 keys (0 volatile) in 16384 slots HT.
[53686] 23 Sep 14:21:00 - DB 1: 320 keys (0 volatile) in 512 slots HT.
[53686] 23 Sep 14:21:00 - DB 2: 1479 keys (0 volatile) in 2048 slots HT.