Skip to content

Instantly share code, notes, and snippets.

@mcongrove
mcongrove / gist:8a90aa9e15267b8d0c7b9860302f1747
Created December 31, 2024 01:04
Miata Registry Sticker
<?xml version="1.0" encoding="utf-8"?>
<DieCutLabel Version="8.0" Units="twips">
<PaperOrientation>Landscape</PaperOrientation>
<Id>Shipping</Id>
<IsOutlined>false</IsOutlined>
<PaperName>30323 Shipping</PaperName>
<DrawCommands>
<RoundRectangle X="0" Y="0" Width="3060" Height="4455" Rx="270" Ry="270" />
<CutoutShape X="280" Y="720" Width="2520" Height="2880" Rx="800" Ry="1620" Style="Solid" />
</DrawCommands>
@mcongrove
mcongrove / 450
Last active November 20, 2024 22:11
Sticker Tests
<?xml version="1.0" encoding="utf-8"?>
<DieCutLabel Version="8.0" Units="twips" MediaType="Default">
<PaperOrientation>Landscape</PaperOrientation>
<Id>30336 1 in x 2-1/8 in</Id>
<PaperName>30336 1 in x 2-1/8 in</PaperName>
<DrawCommands>
<RoundRectangle X="0" Y="0" Width="1440" Height="3060" Rx="180" Ry="180"/>
</DrawCommands>
<ObjectInfo>
<ImageObject>
@mcongrove
mcongrove / sign_commits.md
Created April 5, 2020 23:57
Verify Unsigned Commits

Workaround to verify unsigned commits in github

All commits started from 8fd7b22 will be rebased with no changes except signing.

git rebase --exec 'git commit --amend --no-edit -n -S' -i 8fd7b22
git push --force

Source

@mcongrove
mcongrove / olympiad.md
Last active October 4, 2019 21:16
Pinpoint Olympiad Information

Player Nomination

For many of the events below, teams nominate 1 or 2 players to play on the team's behalf. No player may participate in more than 2 of these nominated events (i.e. you cannot have the same player participate in the basketball, air hockey and foosball).


Events

Round 1, Indoor

defineProperty("viewX", globalPropertyf("sim/graphics/view/view_x"))
defineProperty("viewY", globalPropertyf("sim/graphics/view/view_y"))
defineProperty("viewZ", globalPropertyf("sim/graphics/view/view_z"))
defineProperty("acfX", globalPropertyf("sim/flightmodel/position/local_x"))
defineProperty("acfY", globalPropertyf("sim/flightmodel/position/local_y"))
defineProperty("acfZ", globalPropertyf("sim/flightmodel/position/local_z"))
function cameraDistance()
local cX = (math.abs(get(viewX)) - math.abs(get(acfX)))
local cY = (math.abs(get(viewY)) - math.abs(get(acfY)))
function foo()
if (get(onGround)==1) then
if (get(doorOpen)>=1) then
if (get(engineRunning)==1) then
g = 250
else
g = 500
end
else if (get(viewExternal)==1) then
g = 750
<?php
/**
* Write a script that prints the numbers 1 through 100.
* However, if a number is divisible by 3 then print the word 'Fizz' instead, or the word 'Buzz' if divisible by 5.
* If the number is divisible by both 3 and 5, instead print 'FizzBuzz'.
*/
for($i = 1; $i <= 100; $i++)
{
@mcongrove
mcongrove / gist:1015435
Created June 8, 2011 21:22
getResponseCookies Regex
Test values:
cn1=cv1; Domain=something.org; Max-Age=89000000; Path=/eportal; HttpOnly, cn2=cv2; HttpOnly , cn3=cv3
cn1=cv1; Domain=something.what.org; Path=/eportal; HttpOnly, cn2=cv2; HttpOnly , cn3=cv3;
cn1=cv1; Domain=something.org; Max-Age=890000;,cn2=cv2, cn3=cv3
cn1=cv1; Domain=what.org; Expires=Fri, 21-Mar-2014 16:52:43 GMT; HttpOnly, cname2=cvalue2; HttpOnly
Expression:
([a-zA-Z0-9])+(?<!Domain|Path|Age|Expires)=([a-zA-Z0-9])+
@mcongrove
mcongrove / login.js
Created May 3, 2011 20:14
Simple login example
var login = {
authorized: false,
session_id: null,
init: function() {
// See if we have an existing sess_id
login.session_id = login.checkForSession();
// If not, open login window
if(!login.session_id) {
login.openLoginPage();
@mcongrove
mcongrove / HTML5_Audio_Duration.html
Created April 20, 2011 06:36
Retrieve the duration of an HTML5 audio element.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>HTML5 Audio Duration</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
var audio, duration;
window.onload = function() {
var element = document.createElement("audio");