This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
header = 'Basic ' + base64.b64encode('pager.io:1234567890') | |
print header | |
'Basic cGFnZXIuaW86MTIzNDU2Nzg5MA==' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib, urllib2, base64 | |
team_name = 'My Pager.io Team Name' | |
api_key = 'My Pager.io API Key' | |
alert_subject = 'Test Alert' | |
alert_message = 'This is where you would put a longer alert message' | |
data = {'subject': alert_subject, 'message': alert_message} | |
base64string = base64.encodestring('%s:%s' % (team_name, api_key)).replace('\n', '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
function Account() { | |
this.isValid = false; | |
this.fields = {}; | |
var AccountData = new mongoose.Schema({ | |
createdOn:{type:Date, required:true}, | |
email:{type:String}, | |
phone:{type:String}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)helpButtonWasTapped { | |
[[LIOLookIOManager sharedLookIOManager] beginSession]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[LIOLookIOManager sharedLookIOManager]setUsesControlButton:NO]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[LIOLookIOManager sharedLookIOManager] performSetupWithDelegate:aDelegate]; | |
// Delegate protocol | |
@protocol LIOLookIOManagerDelegate | |
- (UIWindow *)lookIOManangerMainWindowForHostApp:(LIOLookIOManager *)aManager; | |
- (void)lookIOManager:(LIOLookIOManager *)aManager didUpdateEnabledStatus:(BOOL)lookioIsEnabled; | |
- (BOOL)lookIOManager:(LIOLookIOManager *)aManager shouldRotateToInterfaceOrientation:(UIInterfaceOrientation)anOrientation; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ok, Interfaces} = inet:getifaddrs(), | |
Addresses = lists:map(fun({_, Props}) -> proplists:get_all_values(addr, Props) end, Interfaces), | |
Private_Addresses = lists:filter(fun({F,_,_,_}) -> lists:member(F, [10, 172, 192]); (_) -> false end, lists:flatten(Addresses)), | |
io:format("Private Addresses = ~p\n", [Private_Addresses]), | |
case Private_Addresses of | |
[] -> io:format("Unable to start monitor listener, no private address was found.\n", []), | |
undefined; | |
_ -> {A, B, C, D} = lists:nth(1, Private_Addresses), | |
IP_Address = lists:flatten(io_lib:format("~.10B.~.10B.~.10B.~.10B", [A, B, C, D])), | |
io:format("Starting listener on ~s\n", [IP_Address]), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# shove this in ~/.chef/bootstrap/joyent-smartos.erb | |
# run knife bootstrap <hostname> -d joyent-smartos | |
bash -c ' | |
if [ ! -f /opt/local/bin/chef-client ]; then | |
cd /tmp | |
pkgin install gcc-compiler gcc-runtime gcc-tools-0 ruby19 scmgit-base scmgit-docs gmake sun-jdk6 | |
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz | |
tar -xzf rubygems-1.8.10.tgz | |
cd rubygems-1.8.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# shove this in ~/.chef/bootstrap/joyent-smartos.erb | |
# run knife bootstrap <hostname> -d joyent-smartos | |
bash -c ' | |
if [ ! -f /opt/local/bin/chef-client ]; then | |
cd /tmp | |
sudo pkgin -y install gcc-compiler gcc-runtime gcc-tools-0 ruby19 scmgit-base scmgit-docs gmake | |
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz | |
tar -xzf rubygems-1.8.10.tgz | |
cd rubygems-1.8.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% | |
%% run this from the console with the following command: | |
%% | |
%% eunit:test({timeout, 60, mnesia_performance_tests}). | |
%% | |
-module(mnesia_performance_tests). | |
-author('[email protected]'). |
OlderNewer