Skip to content

Instantly share code, notes, and snippets.

View acallaghan's full-sized avatar
🎖️
Probably procrastinating

Andy Callaghan acallaghan

🎖️
Probably procrastinating
View GitHub Profile
@acallaghan
acallaghan / keybase.md
Created February 25, 2020 11:52
keybase proof

Keybase proof

I hereby claim:

  • I am acallaghan on github.
  • I am acallaghan (https://keybase.io/acallaghan) on keybase.
  • I have a public key ASBNPlnaxoKQllYG_IRqckQNr4rO7BZ2KC3-UKtplrerdwo

To claim this, I am signing this object:

protected void btnImportaCodici_Click(object sender, EventArgs e)
{
PixFizzHandler pxHandler = new PixFizzHandler();
try
{
divErrorCodici.Visible = false;
litImportaCodiciCounter.Text = "";
int codiciInseriti = 0;
if (!flUpdCodici.HasFile)
@acallaghan
acallaghan / Missing image order codes
Last active November 30, 2016 12:14
Missing images, sorted list
Orders affected
FDD1-0HJ91G
FDD1-0Q8UYQ
FDD1-185UUN
FDD1-1QEFF5
FDD1-25ZQ6E
FDD1-2ZWRVQ
FDD1-302ER0
FDD1-3X1J6V
// ViewController.swift
import UIKit
import WebKit
class ViewController: UIViewController, WKNavigationDelegate {
@IBOutlet var containerView: UIView!
var webView: WKWebView?
override func loadView() {
{
"vars": {
"@gray-darker": "lighten(#151D26, 13.5%)",
"@gray-dark": "lighten(#151D26, 20%)",
"@gray": "lighten(#151D26, 33.5%)",
"@gray-light": "lighten(#151D26, 46.7%)",
"@gray-lighter": "lighten(#151D26, 93.5%)",
"@brand-primary": "#685C79",
"@brand-success": "#5cb85c",
"@brand-info": "#FFBC67",
/* From http://stephen.io/mediaqueries/ */
/* Non-retina iPad Landscape */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape) {
}
@acallaghan
acallaghan / stack_recombinations.rb
Last active August 29, 2015 14:02
A ruby snippet to recombine an array representing a stack of markup, outputting an orderly stack in parent/child relationship
=begin
<px:categories>
<px:each>
<px:category>
<px:books>
<px:each>
<px:book>
--- Get stack suggestions at this level
=end
@acallaghan
acallaghan / spec_helper.rb
Created November 14, 2013 15:44
Faster BCrypt hashing for RSpec tests
...
silence_warnings do
BCrypt::Engine::DEFAULT_COST = BCrypt::Engine::MIN_COST
end
...
@acallaghan
acallaghan / cassandra_dirty_laundry.rb
Created September 7, 2013 11:33
Using RSpec with Cassandra - conservatively truncating. We use Cassandra and Postgres throughout our app. Cassandra.truncate! is mega slow, and we used to run it in an after(:each) block, slowing down all specs considerably
class Cassandra
alias_method :old_insert, :insert
def insert(column_family, key, hash, options = {})
CASSANDRAS_DIRTY_LAUNDRY << [column_family, key]
self.old_insert(column_family, key, hash, options)
end
@acallaghan
acallaghan / gist:5236544
Created March 25, 2013 11:32
Batch rename files with preview
# List all .rb file beginning with v1_ and change too bar_*.rb
ls v1_*.rb | awk '{print("mv "$1" "$1)}' | sed 's/v1_/bar_/2'
# The same as above, but commit the changes
ls v1_*.rb | awk '{print("mv "$1" "$1)}' | sed 's/v1_/bar_/2' | /bin/sh