This is a simple modification of the Force directed d3.js demo that keeps the x co-ordinate fixed.
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
// WARNING: this code is 80% machine generated with Github Copilot | |
// I've fixed the bugs I've found, but only refactoring in the rare cases I literally can't follow the code. | |
// This is a bad codebase. | |
require("dotenv").config(); | |
const { HeliconeProxyOpenAI} = require("@helicone/helicone"); | |
const { Anthropic } = require('@anthropic-ai/sdk'); | |
const OpenAI = HeliconeProxyOpenAI; | |
const fs = require("fs"); |
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
@rem Simple recursive backup script dave@euri.ca 2011 | |
@echo off | |
rem I strongly recommend backing up to a different drive or machine | |
set sourcedir=c:\projects | |
set destdir=g:\autobackups\projects | |
for /f "tokens=1-3 delims=/ " %%g in ('date /t') do ( | |
set mm=%%g | |
set dd=%%h |
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
Sample PHP code to accept PagerDuty webhooks and send out notifications by email on state changes. | |
For more information, see http://developer.pagerduty.com/documentation/rest/webhooks | |
This example threads emails based on "$status: $description on $service" so each update to each incident would start a new thread. | |
This code is unsupported by PagerDuty. | |
<?php | |
$emailAddress = "CHANGEME@example.com"; | |
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 'pp' | |
require 'httparty' | |
class PagerDuty | |
include HTTParty | |
format :json | |
def initialize(subdomain, api_token) | |
@options = { | |
:headers => { | |
"Authorization" => "Token token=#{api_token}", |
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 'csv' | |
#Parse the CSV that Twilio provides https://www.twilio.com/resources/rates/international-rates.csv | |
numbers = [] | |
CSV.foreach('international-rates.csv', :headers => true) do |row| | |
starts = row[2].split(",") | |
starts.each do |p| | |
numbers.push([p.strip, p.strip.length, row[1], row[0]]) | |
end | |
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
function transform(PD) { | |
var webhook = PD.inputRequest.body | |
var message = webhook.text || "Error: Not a Spark chat message"; | |
var room_link = ciscospark2web(b64decode(webhook.roomId)); // clean up the link | |
var normalized_event = { | |
incident_key: room_link, //So that all messages from a room de_dupee into the same incident | |
event_type: PD.Trigger, | |
description: message, | |
details: { |
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
# Bash script to upload files to static s3 hosting with s3cp | |
# dave@pagerduty.com April 30th, 2013 | |
# Modified from https://github.com/roqs23/sync-svn-updates-to-s3/blob/master/svnupd2s3.sh | |
export COMMON_HEADER="--header \"x-amz-acl: public-read\" --header \"Vary: Accept-Encoding\" " | |
export HTML_HEADER="--header \"Cache-Control: max-age=604800,must-revalidate\" --header \"Content-Type: text/html\"" | |
export CSS_HEADER="--header \"Cache-Control: max-age=604800,must-revalidate\" --header \"Content-Type: text/css\"" | |
export JS_HEADER="--header \"Cache-Control: max-age=604800,must-revalidate\" --header \"Content-Type: application/javascript\"" | |
export PNG_HEADER="--header \"Cache-Control: max-age=2592000,must-revalidate\" --header \"Content-Type: image/png\"" | |
export GIF_HEADER="--header \"Cache-Control: max-age=2592000,must-revalidate\" --header \"Content-Type: image/gif\"" |
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
<? | |
// One Time Pad from string demo. | |
// http://euri.ca/2012/11/encryption-that-calls-home-skyfall-movie-magic/ | |
// Don't use this in production, obviously since you can brute force the seed. | |
// (Actually coming up with a server that generates OTPs in response to a seed is a decent problem) | |
$seed = "LOCALSECRET" + $_SERVER["QUERY_STRING"]; | |
$hash = hash('sha256', $seed); | |
$dec = hexdec($hash); | |
mt_srand($dec); |
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 off | |
set destdir=G:\autobackups | |
set devicefile=htc_desire | |
for %%d in (E F G H I J K L) do ( | |
if exist %%d:\%devicefile% ( | |
echo %%d is the %devicefile% | |
xcopy %%d:\ "%destdir%\%devicefile%" /V /E /D /C /I /Y > %destdir%\%devicefile%\lastbackup.txt | |
) | |
) |
NewerOlder