This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using NUnit.Framework; | |
namespace MyProject | |
{ | |
[TestFixture] |
This file contains hidden or 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
// In Sublime: | |
// - Install SublimeClang | |
// - save new sublime project in your Arduino project folder (e.g. My Documents\Arduino I think is the default) | |
// - Project -> Edit Project | |
// - paste into file | |
// - now your code is recompiled on the fly | |
// - note this just handled .cpp and .h you'll need to convert your .ino to compile the sketch | |
// Credits: many of the compile options are from http://blog.tzikis.com/?p=454 | |
{ |
This file contains hidden or 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 webClient = new WebClient(); | |
webClient.Headers.Set("X-ApiKey", "KbI9MZtLvhaOuAi0DKXWzc4UZk-SAKxhQjd3MHJtd2ZwYz0g"); | |
var response = webClient.UploadString( | |
"http://api.cosm.com/v2/feeds/92158/datastreams/WaterLevel/datapoints", | |
"POST", | |
@"{ | |
""datapoints"":[ | |
{""at"":""2012-12-18T04:00:00Z"",""value"":""294""}, | |
{""at"":""2012-12-18T04:01:00Z"",""value"":""295""}, | |
{""at"":""2012-12-18T04:02:00Z"",""value"":""296""}, |
This file contains hidden or 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
public static string CreateDatapoint(string feedId, string datastreamId, string value) | |
{ | |
string url = string.Format("http://api.cosm.com/v2/feeds/{0}/datastreams/{1}/datapoints", feedId, datastreamId); | |
var datapoints = new {datapoints = new[] {new {at = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ"), value}}}; | |
var datapointsJson = new JavaScriptSerializer().Serialize(datapoints); | |
var webClient = new WebClient(); | |
webClient.Headers.Set("X-ApiKey", "KbI9MZtLvhaOuAi0DKXWzc4UZk-SAKxhQjd3MHJtd2ZwYz0g"); | |
return webClient.UploadString(url, "POST", datapointsJson); | |
} |
This file contains hidden or 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
sc stop WMPNetworkSvc | |
sc config WMPNetworkSvc start= disabled | |
c:\windows\system32\sysprep\sysprep /generalize /oobe /shutdown |
This file contains hidden or 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
#!/usr/bin/env bash | |
# | |
# Saves all dashboards in Kibana to /vagrant/dashboards | |
# so they can be reloaded if this vagrant instance is destroyed | |
# | |
curl -s 'http://localhost:9200/kibana-int/dashboard/_search?pretty=true&fields=' | grep "_id" | sed -E 's/.*"_id" : "(.*)",/\1/' | while read -r line; do curl -s -X GET http://localhost:9200/kibana-int/dashboard/$line/_source > /vagrant/dashboards/$line.json; done | |
This file contains hidden or 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
# | |
# Copy logs from the vagrant share (hosted by Windows) to ~/logs | |
# This is because logstash tracks files using their inode number | |
# but this number may change each time the vm is booted. | |
# | |
# rsync options | |
# -r recursive | |
# -t transfer file mod times and use to skip files | |
# -v verbose | |
# --inplace update files rather than write new and rename |
This file contains hidden or 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
D:\temp\test> mkdir source | |
# | |
# | |
# Directory: D:\temp\test | |
# | |
# | |
# Mode LastWriteTime Length Name | |
# ---- ------------- ------ ---- | |
# d---- 9/15/2014 7:42 PM source | |
# |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am brianlow on github. | |
* I am brianlow (https://keybase.io/brianlow) on keybase. | |
* I have a public key whose fingerprint is 0288 6EAD 4693 8368 DF86 798D 2B90 84AA 83D7 20FE | |
To claim this, I am signing this object: |
This file contains hidden or 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
# Add an application at https://developer.spotify.com/my-applications | |
# Whitelist redirect url http://posthere.io/brians-importer | |
# Copy client id into url below | |
# https://accounts.spotify.com/authorize?client_id=4260a40e3f514766802819f094e3be82&redirect_uri=http%3A%2F%2Fposthere.io%2Fbrians-importer&response_type=token&scope=playlist-read-private%20playlist-modify-public%20playlist-modify-private%20user-library-read%20user-library-modify | |
# Browse to URL | |
# On successful authorization, you will be redirected, from this URL copy the token param in variable below | |
require 'httparty' | |
token = '... your token here ...' |
OlderNewer