Skip to content

Instantly share code, notes, and snippets.

@BinaryPaean
BinaryPaean / day1.py
Created December 1, 2023 23:19
Python Advent of Code 2023 - Day 1
import re
import array
import sys
def handle_elf_line(line):
"Processes a single line from the input file for the 2023 advent of code."
rstring = r'(?=(\d|one|two|three|four|five|six|seven|eight|nine))'
elfnums = re.compile(rstring)
translate = {
@BinaryPaean
BinaryPaean / BusyBox.sh
Created July 9, 2020 18:08
G4 Pro Camera Disk Usage
UVC.v4.23.8.67# du /* -hsc
27.2M /bin
0 /dev
0 /etc
1008.0K /home
42.4M /lib
8.0K /linuxrc
0 /mnt
0 /proc
172.0K /root
@BinaryPaean
BinaryPaean / keybase.md
Created June 15, 2017 20:00
Keybase Claim

Keybase proof

I hereby claim:

  • I am binarypaean on github.
  • I am binarypaean (https://keybase.io/binarypaean) on keybase.
  • I have a public key ASAUC1prXv5Iamzs6lCDFJbg3l4PDH77l5-BnztXwGGhawo

To claim this, I am signing this object:

#Undef loc var>!
class Account
attr_reader :name
attr_reader :balance
def initialize(name, balance=100)
@name = name
@balance = balance
end
<div id="EmployeePhoneField">
<!--#_
var encodedWphone = $htmlEncode(ctx.CurrentItem.Workphone);
var displayWphone = Srch.U.getSingleHHXMLNodeValue(hhProps, "workphone");
console.log(displayWphone);
if ($isEmptyString(displayWphone)) { displayWphone = encodedWphone }
var firstDigitsDisplayWPhone = displayWphone.slice(0,-3);
var lastThreeDigitsWPhone = displayWphone.slice(-3);
_#-->
<div id="EmployeePhoneValue" class="ms-srch-ellipsis" title="_#= encodedWphone =#_">P: _#= firstDigitsDisplayWPhone =#_<strong>_#l=astThreeDigitsWPhone=#_</strong></div>
@BinaryPaean
BinaryPaean / oro-crm-clank
Created July 1, 2014 17:33
Monit config file to watch oro crm clank server launched with nohup
check process clank with pidfile /var/run/clank.pid
group www
start program = "/etc/monit/launch-clank.sh"
stop program = "/bin/kill `/bin/cat /var/run/clank.pid`"
#! /bin/sh
/usr/bin/nohup /usr/bin/php /var/www/oro-crm/app/console clank:server --env prod > /dev/null 2>&1 & echo $! > /var/run/clank.pid
@BinaryPaean
BinaryPaean / haml1.haml
Created April 25, 2012 21:09
Illustration of yaml extraction bug
---
title: yaml haml
---
%h2 A Haml Title
%p
This is my test text.