Skip to content

Instantly share code, notes, and snippets.

Avatar
🦄
[object Object]

Aaron Crowder CrowderSoup

🦄
[object Object]
View GitHub Profile
@CrowderSoup
CrowderSoup / script.rb
Created May 25, 2022
Disable discount codes for orders containing gift cards
View script.rb
class Campaign
def initialize(condition, *qualifiers)
@condition = (condition.to_s + '?').to_sym
@qualifiers = PostCartAmountQualifier ? [] : [] rescue qualifiers.compact
@line_item_selector = qualifiers.last unless @line_item_selector
qualifiers.compact.each do |qualifier|
is_multi_select = qualifier.instance_variable_get(:@conditions).is_a?(Array)
if is_multi_select
qualifier.instance_variable_get(:@conditions).each do |nested_q|
@post_amount_qualifier = nested_q if nested_q.is_a?(PostCartAmountQualifier)
@CrowderSoup
CrowderSoup / tasks.json
Last active Apr 14, 2017
VSCode Task for serving swagger docs with http://goswagger.io
View tasks.json
{
"version": "0.1.0",
"command": "bash",
"isShellCommand": true,
"showOutput": "always",
"args": [
"-c"
],
"tasks": [{
"taskName": "swagger",
@CrowderSoup
CrowderSoup / gitkraken_crash.log
Created Jan 29, 2016
Crash log from GitKraken
View gitkraken_crash.log
PID 13880 received SIGSEGV for address: 0xf00ba1c8
SymInit: Symbol-SearchPath: '.;C:\Users\acrowder\AppData\Local\gitkraken\app-0.6.0;C:\Users\acrowder\AppData\Local\gitkraken\app-0.6.0;C:\WINDOWS;C:\WINDOWS\system32;SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 530, UserName: 'acrowder'
OS-Version: 10.0.10240 () 0x100-0x1
00007FFDDD28296B (segfault-handler): (filename not available): (function-name not available)
00007FFDDD281417 (segfault-handler): (filename not available): (function-name not available)
00007FFDF2C02347 (ntdll): (filename not available): RtlNormalizeString
00007FFDF2BB38FE (ntdll): (filename not available): RtlWalkFrameChain
00007FFDF2BB21C4 (ntdll): (filename not available): RtlRaiseException
00007FFDF00BA1C8 (KERNELBASE): (filename not available): RaiseException
00007FFDF05A9931 (RPCRT4): (filename not available): RpcRaiseException
@CrowderSoup
CrowderSoup / hourOfCode.js
Created Dec 9, 2015
Hour Of Code Star Wars Game
View hourOfCode.js
var game = function () {
setBackground("random");
setMap("random");
setDroid("R2-D2");
setDroidSpeed("normal");
playSound("R2-D2random");
var moved = false;
var points = 0;
@CrowderSoup
CrowderSoup / drowningbot.js
Created Aug 20, 2015
A bot to play "Drowning in Problems" for you. http://game.notch.net/drowning/
View drowningbot.js
var interval = setInterval(function(){
var aTags = document.getElementsByTagName("a");
// Bail out if we didn't find any anchor tags.
if(aTags.length <= 0) {
return;
}
// Get the IDs of the tags we're going to click
var aTagIds = [];
View keybase.md

Keybase proof

I hereby claim:

  • I am CrowderSoup on github.
  • I am crowdersoup (https://keybase.io/crowdersoup) on keybase.
  • I have a public key whose fingerprint is CF37 B14A 2FB4 F73B FFD5 8C01 680E C0CD 3F2D 62A0

To claim this, I am signing this object:

@CrowderSoup
CrowderSoup / imgresizr.py
Last active Aug 29, 2015
Just a quick example of how to resize an INCREDIBLY large image.
View imgresizr.py
from PIL import Image
# 8 Inches
basewidth = 768
# This is the size of the image I was working with... this line will supress warnings about the image being too big
Image.MAX_IMAGE_PIXELS = 556631040
# Open the image
img = Image.open("original.png")
@CrowderSoup
CrowderSoup / footerExtend.js
Created May 20, 2014
Extend footer to take up the remainder of the viewport
View footerExtend.js
var viewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var footerDistanceFromTop = $('.footer').offset().top;
if (footerDistanceFromTop < viewportHeight) {
var footerHeight = viewportHeight - footerDistanceFromTop;
var footerMinHeight = parseInt($('.footer').css('min-height').split('px')[0]);
if (footerHeight > footerMinHeight) {
$('.footer').css('height', footerHeight + 'px');
}
@CrowderSoup
CrowderSoup / find_replace.js
Created Feb 19, 2014
Replace all instances of a substring without Regex in JavaScript
View find_replace.js
var str = 'This is a test string.';
// Let's replace all spaces with ','
str = str.split(' ').join(',');
@CrowderSoup
CrowderSoup / screenshot.js
Created Jan 24, 2014
A Phantom.js script to take a screenshot of any website.
View screenshot.js
var page = require('webpage').create(),
system = require('system'),
t, address;
if (system.args.length === 1) {
console.log('Usage: screenshot.js <some URL>');
phantom.exit();
}
address = system.args[1];