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
#include <ESP8266WiFi.h> | |
#include <WiFiClient.h> | |
#include <ESP8266WebServer.h> | |
#include <ESP8266mDNS.h> | |
const char* ssid = "........"; | |
const char* password = "........"; | |
ESP8266WebServer server(80); |
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
blueprint: | |
name: Amber Light | |
description: Change the colour of a lamp based on the current Amber price | |
domain: automation | |
input: | |
amber_price_sensor: | |
name: Amber Price Sensor | |
description: The Amber price sensor you wish to track. If in doubt, use General Price. | |
selector: | |
entity: |
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
/* hello-ftdi.c: flash LED connected between CTS and GND. | |
This example uses the libftdi API. | |
Minimal error checking; written for brevity, not durability. */ | |
#include <stdio.h> | |
#include <ftdi.h> | |
#include <time.h> | |
#define CTS 0x08 /* CTS (brown wire on FTDI cable) */ |
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
#!/usr/bin/env ruby -w | |
require 'csv' | |
file = ARGV[0] | |
out = file.split('.').join('-normalized.') | |
unless file | |
puts "Usage: normalize [filename]" | |
exit(1) | |
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
#!/usr/bin/env ruby -w | |
require 'csv' | |
file = ARGV[0] | |
out = file.split('.').join('-normalized.') | |
unless file | |
puts "Usage: normalize [filename]" | |
exit(1) | |
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
#!/usr/bin/env ruby -w | |
require 'csv' | |
file = ARGV[0] | |
out = file.split('.').join('-compressed.') | |
unless file | |
puts "Usage: compress [filename]" | |
exit(-1) | |
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
var svg = (!!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect); |
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
The Problem: We have a WCF JSON API, that we need to make accessible from third-party sites (on IE7+), so JSON-P looks like a good solution. | |
Issue is, (what the .NET guy here has told me), each endpoint in the WCF router will need to be re-written (or added to) to handle GETs (We currently use GET, POST, and DELETE depending on the action). That sucks. | |
My idea: An IIS module (handler?) that intercepts JSON-P requests, and transforms the request to something the WCF router can handle, then pads the response. Basically transparent JSON-P padding around WCF. | |
Make sense? Does this exist already? |
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
class Foo | |
def this_fails | |
puts self.bar | |
end | |
def this_works | |
puts bar | |
end | |
private |
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
def haversine(x, y) | |
r = 6371 | |
lat1 = x.latitude | |
lat2 = y.latitude | |
lon1 = x.longitude | |
lon2 = y.longitude | |
d_lat = (lat2 - lat1) * Math::PI / 180 | |
d_lon = (lon2 - lon1) * Math::PI / 180 | |
NewerOlder