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
;; Copyright 2019, Chris Marchetti | |
;; This program is free software: you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or | |
;; (at your option) any later version. | |
;; This program is distributed in the hope that it will be useful, | |
;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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 interpolate(a, b, ratio) { | |
return ratio * (b - a) + a; | |
} | |
function Point(x, y) { | |
return {x: x, y: y}; | |
} | |
function bezier(points, ratio) { | |
if (points.length < 2) return null; |
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
import base64 | |
import hmac | |
import struct | |
import sys | |
import time | |
from urllib.parse import unquote | |
def generate_hotp_code(secret, counter, hash_algo='sha1', size=6): | |
""" | |
Generates a HOTP code. |
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
# Checks if the argument string is blank | |
proc is_blank {x} { | |
return [string equal $x {}] | |
} | |
namespace eval fixture { | |
namespace export create execute | |
namespace ensemble create | |
# Creates a new fixture, which contains a group of tests and an optional |
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
(require 'browse-url) | |
(require 'helm) | |
(require 'seq) | |
(require 'url) | |
(defun xml-node (node) | |
"Returns the symbol for the node type (e.g. 'li for <li>...</li>)" | |
(car node)) | |
(defun xml-attr (node attr) |
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
proc jdbc_command {options} { | |
set classpath [lindex $options 0] | |
set commands {/usr/bin/java -classpath} | |
lappend commands "/home/chris/Source/jdbcnotebook/target/server-1.0-SNAPSHOT-jar-with-dependencies.jar:$classpath" | |
lappend commands {*}[lrange $options 1 end] | |
return $commands | |
} |
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
vec4 colorAt(in vec2 coord, in int channel) { | |
if (channel == 0) return texture2D(iChannel0, coord.xy / iChannelResolution[0].xy); | |
if (channel == 1) return texture2D(iChannel1, coord.xy / iChannelResolution[1].xy); | |
if (channel == 2) return texture2D(iChannel2, coord.xy / iChannelResolution[2].xy); | |
if (channel == 3) return texture2D(iChannel3, coord.xy / iChannelResolution[3].xy); | |
} | |
float monochrome(in vec4 color) { | |
return (color.r + color.g + color.b) / 3.0; | |
} |
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
""" | |
Interfacing with the HP 3050A to automate scanning. | |
Copyright (c) 2014, Adam Marchetti | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, | |
are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this |
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/Rscript | |
printf <- function(fmt, ...) cat(sprintf(fmt, ...)) | |
# Reads a Ledger file by doing CSV export on the CLI, and then slurping | |
# it into R's CSV reader. | |
# | |
# start and end can be used to limit which entries are allowed in by time, | |
# and accounts can be used to limit which accounts are read. | |
ledger.read <- function(filename, | |
start=NA, |
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
using System; | |
using System.IO; | |
using System.Xml; | |
using System.Xml.Xsl; | |
namespace XSLTEvaluator | |
{ | |
public class MainClass | |
{ | |
public static void Main(string[] Args) |