This is a simple example of the MQTT protocol with Node.js. The client code has also been tested with a combination of C++ servers and clients.
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
-- ------------------------------------------------------------------------------------------------------- | |
-- A SQL script for importing GFTS data from the State of Delaware into a MySQL database. | |
-- | |
-- Copyright 2010 Mark J. Headd | |
-- http://www.voiceingov.org | |
-- | |
-- This file is free software; you can redistribute it and/or modify it under the terms of the | |
-- GNU Library General Public License as published by the Free Software Foundation; either version 2 of the | |
-- License, or (at your option) any later version. | |
-- This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
-- ------------------------------------------------------------------------------------------------------- | |
-- A SQL script for importing GFTS data from the State of Delaware into a MySQL database. | |
-- | |
-- Copyright 2010 Mark J. Headd | |
-- http://www.voiceingov.org | |
-- | |
-- This file is free software; you can redistribute it and/or modify it under the terms of the | |
-- GNU Library General Public License as published by the Free Software Foundation; either version 2 of the | |
-- License, or (at your option) any later version. | |
-- This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
-- ---------------------------------------------------------------------------------------------------- | |
-- Stored Procedures for querying GFTS data from the State of Delaware in a MySQL database. | |
-- | |
-- Copyright 2010 Mark J. Headd | |
-- http://www.voiceingov.org | |
-- | |
-- This file is free software; you can redistribute it and/or modify it under the terms of the | |
-- GNU Library General Public License as published by the Free Software Foundation; either version 2 of the | |
-- License, or (at your option) any later version. | |
-- This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
parse(Text) when is_binary(Text) -> | |
parse(binary_to_list(Text)); | |
parse(Text) when is_list(Text) -> | |
parse(Text, [], 0, []). | |
parse(Text, Env, Line, Acc) -> | |
case erl_scan:tokens([], Text, Line) of | |
{done, {ok, Scanned, NewLine}, Rest} -> | |
{ok, Parsed} = erl_parse:parse_exprs(Scanned), |
# Five lines of code that will make your underscore + CoffeeScript use cleaner. | |
# Creates an underscore function for each function in to_reverse with R (short for Reversed) appended to the name. | |
# The R version moves the function argument (first argument in normal underscore) to the end, | |
# so you can write: | |
$(window).scroll _.throttleR 500, -> | |
console.log "This print's at most every 500ms" | |
# Instead of: | |
$(window).scroll _.throttle -> | |
console.log "This prints at most every 500ms too" |
CREATE TABLE Subman_Publisher | |
( | |
id string AUTO PRIMARY KEY, -- auto-generated, uuid | |
stacks set of string REFERENCES Subman_Stack, -- primary key ref | |
subscription_count int | |
); | |
CREATE TABLE Subman_Stack | |
( |
Having worked with iOS almost exclusively the past year, there's a few things that I commonly reuse that may be of use to you. If any of this is of interest to you, let me know. I'm trying to prioritize what I'll release first.
-
BBRefreshWebView - A pattern for applying pull-to-refresh functionality to a UIWebView. The goal here is to make it feel as native as possible. Inspired by the Facebook app for iOS.
-
Backlight - Backlight aims to make location tracking more battery-efficient by triggering location tracking only while the user is moving. If an idle period is detected, accurate location tracking is disabled and only re-started if the user moves a significant distance.
-
BBAutoLoadCellView - A way to implement infinite scroll in table views. If the user scrolls to the bottom (or top), a refresh event is triggered and a UIActivityIndicator is displayed.
-
BBChatTableView - iMessage-style chat interface. This is something that I've re-implemented time and time again, there's some tedious aspects that
#!/usr/bin/env sh | |
sudo mkdir -p /Library/Internet\ Plug-Ins/disabled && | |
sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/disabled && | |
sudo ln -s /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin |