Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am machavity on github.
  • I am machavity (https://keybase.io/machavity) on keybase.
  • I have a public key ASBV12Cgl-j8phkbjyxCDTMjvp8m_3eq7TjZPr8E_6OZego

To claim this, I am signing this object:

@machavity
machavity / rfc.MD
Last active November 21, 2019 15:41
Mysqli bind single parameter

Prepared statements have become more important of late. By breaking a query into instructions and data, we avoid the problem of SQL injection. While MySQLi supports prepared statements, it has a structural deficiency that PDO does not share. MySQLi does not support binding parameters separately.

Consider the following query (which we will put into a variable called $sql)

INSERT INTO db.visits(page, ip) VALUES(?, ?)

Within PDO we can do the following

@machavity
machavity / gist:420197ff9108e0b757c9bbb7d487f965
Created May 2, 2019 23:55
Hide Stack Overflow Sidebar Userscript
// ==UserScript==
// @name Hide Stack Overflow Sidebar
// @namespace SOCVR
// @version 0.1
// @description Hides the sidebar
// @author Machavity
// @include /^https?:\/\/(.*\.)?stackoverflow\.com/.*$/
// @exclude *://chat.stackexchange.com/*
// ==/UserScript==
So I'm throwing my (hard) hat into the ring again.
I've become more active in the burnination process over at Trogdor and have been doing a lot more with the mods.
I mean, I'm practically Bhargav's best friend now* (in Trogdor, mostly because nobody else is in there).
I spend a fair amount of time in the room, participate in Smokey, and have memorized the Makyen Code of Conduct...
wait, he has a userscript for that. I think I can help in the oddball times I sometimes pop into the room and Compass is eating the flowers.
If you have questions, that's understandable. I can try to answer them, but forgive me if I try to close them instead.
@machavity
machavity / gist:ea0cf9346eb20ee37305dd86f8e8ce23
Last active November 5, 2017 18:26
SOCVR RO nomination

So I'll throw my hat into the ring for RO

I promise to make SOCVR great again! A close vote on every pot! Or is it pot for the CVs? I forget.

More or less, I'm jumping in to run cleanup at slow times. The CV script doesn't do so hot when the CVQ gets full, especially on the weekends I'd just run cleanup at odd times. I mean, that's all ROs do anyways, right?. That and yell at people about the rules and stuff. Or stay off the lawn and flowers.