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
function layout() { | |
return { | |
name: "Quadrants", | |
getFrameAssignments: (windows, screenFrame) => { | |
const columnWidth = screenFrame.width / 2; | |
const rowHeight = screenFrame.height / 2; | |
const frames = windows.map((window, index) => { | |
const frame = { | |
x: screenFrame.x + (columnWidth * (index % 2)), | |
y: screenFrame.y + (index < 2 ? 0 : rowHeight), |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Dragon Drop</title> | |
<style> | |
:root { | |
--background-color: #181824; | |
--text-color: #fff; | |
--scrollbar-thumb-color: #fff; |
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 from deleteme2 |
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" | |
"io" | |
"os" | |
"strings" | |
) | |
func main() { |
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 demo_test | |
import ( | |
"testing" | |
"github.com/frazercomputing/f4/demo" | |
) | |
func TestToUpper(t *testing.T) { | |
t.Parallel() |
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" | |
"io/ioutil" | |
"net/http" | |
"regexp" | |
) | |
func main() { |
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
// This gist is a reminder to myself about the differences between throttling and debouncing, inspired by | |
// https://redd.one/blog/debounce-vs-throttle | |
// | |
// A runnable example is available here: https://play.golang.org/p/sADDu829fRa | |
package main | |
import ( | |
"fmt" | |
"time" | |
) |
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
from PyPDF2 import PdfFileWriter, PdfFileReader | |
import StringIO | |
from reportlab.pdfgen import canvas | |
from reportlab.lib.pagesizes import letter | |
# Create a new PDF with the text to overlay | |
packet = StringIO.StringIO() | |
can = canvas.Canvas(packet) | |
can.drawString(200, 100, "Goodbye World") | |
can.save() |
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
// This gist is a reminder to don't be like me and forget that you can | |
// use complex keys for maps. | |
// | |
// https://play.golang.org/p/KCJ58WH2jU- | |
package main | |
import "fmt" | |
func main() { | |
// Before continuing to the details, confirm for yourself that |
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
// This gist is an experiment toward safer logs that don't leak PII or secrets. We present three different logging | |
// implementations and outline the pros and cons of both. Ultimately, however, the "safeish" version provides the | |
// best mix of developer-friendliness and safety. | |
// | |
// Note that none of the safety mechanisms here apply in cases where fields of a data type are logged directly, but | |
// if log.Printf(data.Password) passes code review, there are other problems. | |
// | |
// A runnable version of this is available at: | |
// https://play.golang.org/p/_jePSMkWM1O | |
package main |
NewerOlder