View logging.go
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
package logger | |
import ( | |
"encoding/json" | |
"fmt" | |
"io" | |
"log" | |
"os" | |
"runtime" | |
"time" |
View client.html
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Server-sent events demo</title> | |
</head> | |
<body> | |
<button>Close the connection</button> | |
<ul> | |
</ul> |
View main.go
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"os" | |
"time" | |
"github.com/stianeikeland/go-rpio" | |
) |
View talkingskull.ino
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 <Servo.h> // Standard servo library | |
Servo myservo; | |
#define SERVO_PIN 9 // Set to the controller pin for the servo | |
int servo_pos = 0; | |
int val1; // Floating value 1 | |
int val2; // Floating value 2 | |
int val3; // Floating value 3 |
View command.go
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
package main | |
import ( | |
"log" | |
"os/exec" | |
"time" | |
) | |
func main() { | |
// Start a process: |
View main.go
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
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"errors" | |
"log" | |
"net/http" | |
"time" | |
) |
View main.go
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
package main | |
import ( | |
"log" | |
qrcode "github.com/skip2/go-qrcode" | |
) | |
func main() { | |
err := qrcode.WriteFile("https://www.danesparza.net", qrcode.Medium, 128, "qr.png") |
View lastqueries.sql
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
SELECT TOP 50 * FROM(SELECT COALESCE(OBJECT_NAME(s2.objectid),'Ad-Hoc') AS ProcName, | |
execution_count,s2.objectid, | |
(SELECT TOP 1 SUBSTRING(s2.TEXT,statement_start_offset / 2+1 , | |
( (CASE WHEN statement_end_offset = -1 | |
THEN (LEN(CONVERT(NVARCHAR(MAX),s2.TEXT)) * 2) | |
ELSE statement_end_offset END)- statement_start_offset) / 2+1)) AS sql_statement, | |
last_execution_time | |
FROM sys.dm_exec_query_stats AS s1 | |
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS s2 ) x | |
WHERE sql_statement NOT like 'SELECT TOP 50 * FROM(SELECT %' |
View main.go
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
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"time" | |
"github.com/danesparza/ical" | |
"github.com/teambition/rrule-go" |
View main.go
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
package main | |
import ( | |
"log" | |
"os/exec" | |
) | |
func main() { | |
// First, query the OS to get a list of Wifi AP SSIDs |
NewerOlder