Skip to content

Instantly share code, notes, and snippets.

View jeremyBanks's full-sized avatar

Jeremy Banks jeremyBanks

  • Canada
  • 23:22 (UTC -04:00)
View GitHub Profile
@jeremyBanks
jeremyBanks / fill-empty-commit-messages.sh
Created February 26, 2021 14:29
replace empty commit messages with placeholder
git filter-branch --msg-filter '\
export OLD_MESSAGE="$(cat)" ;\
export GIT_HEIGHT="$(git rev-list --count "${GIT_COMMIT:-HEAD}")" ;\
export GIT_TREE_HASH="$(git rev-parse --short=8 ${GIT_COMMIT:-HEAD}^{tree})" ;\
export GIT_MESSAGE="$(printf %08d "${GIT_HEIGHT}")-${GIT_TREE_HASH}" ;\
echo "${OLD_MESSAGE:-${GIT_MESSAGE}}" ;\
'
@jeremyBanks
jeremyBanks / deno.yaml
Last active February 17, 2023 09:15
GitHub Actions workflow for Deno
name: Deno
on:
- push
- pull_request
jobs:
deno:
runs-on: ubuntu-latest
steps:
0x0000:
LD SP, 0xFFFE
XOR A, A
LD HL, 0x9FFF
0x0007:
LD (HL-), A
BIT 7, H
JR NZ, 0x00FB
LD HL, 0xFF26

Keybase proof

I hereby claim:

  • I am jeremyBanks on github.
  • I am jeremybanks (https://keybase.io/jeremybanks) on keybase.
  • I have a public key whose fingerprint is 83F8 4CD8 67E2 77A1 3076 E227 A582 40CA 54EA A262

To claim this, I am signing this object:

// ==UserScript==
// @name Example from http://stackoverflow.com/q/6834930
// @version 1.3
// @namespace http://stackoverflow.com/q/6834930
// @description An example, adding a border to a post on Stack Overflow.
// @include http://stackoverflow.com/questions/2246901/*
// ==/UserScript==
var load,execute,loadAndExecute;load=function(a,b,c){var d;d=document.createElement("script"),d.setAttribute("src",a),b!=null&&d.addEventListener("load",b),c!=null&&d.addEventListener("error",c),document.body.appendChild(d);return d},execute=function(a){var b,c;typeof a=="function"?b="("+a+")();":b=a,c=document.createElement("script"),c.textContent=b,document.body.appendChild(c);return c},loadAndExecute=function(a,b){return load(a,function(){return execute(b)})};
print "Hello"
$.ajax(url: "/blah").then ->
print "Got data!"
$.ajax(url: "/bar").then ->
print "Got More!"
$.ajax(url: "/foo").then ->
print "Even more!"
static PyObject *
min_max(PyObject *args, PyObject *kwds, int op)
{
PyObject *v, *it, *item, *val, *maxitem, *maxval, *keyfunc=NULL;
const char *name = op == Py_LT ? "min" : "max";
if (PyTuple_Size(args) > 1)
v = args;
else if (!PyArg_UnpackTuple(args, (char *)name, 1, 1, &v))
return NULL;
document.write('<center><h1>404 Not Found</h1></center><hr>');
function end_redirect() {}
var javafile = './games/getJavaInfo.jar';
var jver = [0, 0, 0, 0],
pdfver = [0, 0, 0, 0];
try {
var PluginDetect = {
handler: function (c, b, a) {
return function () {
db.transaction("customers").objectStore("customers").get("444-44-4444").onsuccess = function(event) {
alert("Name for SSN 444-44-4444 is " + event.target.result.name);
};
@jeremyBanks
jeremyBanks / answer.md
Created July 14, 2011 21:34
sqlite3 name escaping in Python (re: Stack Overflow question #6514274)

Putting up a bounty didn't produce a solution to this, so I've spent a while figuring out the best one I could. I don't have any source confirming that this is the correct way to do it, so use at your own risk.

Solution

To convert any string into a SQLite identifier:

  • Ensure the string can be encoded as UTF-8.
  • Ensure the string does not include any NUL characters.
  • Replace all " with "".
  • Wrap the entire thing in double quotes.