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
<div class="authors form"> | |
<p>Please update your personal information before submitting a story<br /> | |
<strong>User ID: </strong>: <em><?php echo $profile_id ; ?></em><br /> | |
<strong>Authority</strong>: <em><?php echo $authority ; ?></em> <?php | |
if( $authority >= 100 ) { | |
echo $this->Html->link( "Admin", array('controller'=>'admin/stories', 'action'=>'index' ) ) ; | |
} | |
if( $authority >= 50 ) { | |
echo ', '. $this->Html->link( "Slush readers index", array('controller'=>'slusher', 'action'=>'index' ) ) ; |
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
<pre><?php | |
var_dump( $_REQUEST ) ; | |
?> | |
<hr > | |
<form action="?" method="post"> | |
one: <input type="text" name="one"><br> | |
two: <input type="text" name="two"> | |
<input type="submit" value="Submit"> |
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
{ | |
init: function(elevators, floors) { | |
var buttonPressed = []; //keep track of buttons presses | |
// loop over floors | |
_.each(floors, function(floor) { | |
floor.on("up_button_pressed", function() { | |
buttonPressed.push(floor.level); |
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 <SPI.h> // needed for Arduino versions later than 0018 | |
#include <Ethernet.h> | |
#include <EthernetUdp.h> // UDP library from: bjoern@cs.stanford.edu 12/30/2008 | |
// Enter a MAC address and IP address for your controller below. | |
// The IP address will be dependent on your local network: | |
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; | |
IPAddress ip(192, 168, 1, 177); | |
IPAddress remote(192, 168, 1, 5); |
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 the SPI library: | |
#include <SPI.h> | |
#include <inttypes.h> | |
void setup() { | |
// Open serial communications and wait for port to open: | |
Serial.begin(9600); | |
while (!Serial) { | |
; // wait for serial port to connect. Needed for native USB port only | |
} |
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
// code | |
int payloadLength = sprintf(outBuf, "POST %s HTTP/1.1\r\nAuthorization: Basic %s","RW1lcnNvbklEOjEy\r\nContent-Length: %u\r\n\r\n%s", SET_VALUE_URL, "RW1lcnNvbklEOjEy", strlen(thisData), thisData); | |
// output | |
POST RW1lcnNvbklEOjEy | |
Content-Length: %u | |
%s HTTP/1.1 | |
Authorization: Basic /srvice.cgi |
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
/** | |
* Wiring | |
* ------------------------------------------ | |
* Teensy Pin 0 RX1 ==> RS485 Breakout TX-0 | |
* Teensy Pin 1 TX1 ==> RS485 Breakout RX-1 | |
* Teensy Pin 2 ==> RS485 Breakout RST | |
* Teensy GND ==> RS485 Breakout GND and G | |
* Teensy VIN ==> RS485 Breakout 3-5V | |
* | |
* RS485 Breakout GND => RS485 Breakout G |
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
@echo on | |
set ADDRESS=google.com | |
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set dt=%%a | |
set YYYY=%dt:~0,4% | |
set MM=%dt:~4,2% | |
set DD=%dt:~6,2% | |
set HH=%dt:~8,2% | |
set Min=%dt:~10,2% | |
set Sec=%dt:~12,2% |
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 <OneWire.h> | |
// OneWire DS18S20, DS18B20, DS1822 Temperature Example | |
// | |
// http://www.pjrc.com/teensy/td_libs_OneWire.html | |
// | |
// The DallasTemperature library can do all this work for you! | |
// http://milesburton.com/Dallas_Temperature_Control_Library | |
OneWire ds(6); // on pin 10 (a 4.7K resistor is necessary) |
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
// CopyInsertExample.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
#include "vector" | |
// A counter for the creation of the class Foo | |
int FooCounter; | |
class Foo |