Skip to content

Instantly share code, notes, and snippets.

@danyay
danyay / .config.inc.php
Created December 23, 2016 16:07
AWS config file for order_notify
<?php
/************************************************************************
* REQUIRED
*
* Access Key ID and Secret Acess Key ID, obtained from:
* http://aws.amazon.com
***********************************************************************/
define('AWS_ACCESS_KEY_ID', 'TODO');
define('AWS_SECRET_ACCESS_KEY', 'TODO');
@danyay
danyay / order_notify.php
Last active December 23, 2016 22:31
Send a Pushover notification when new orders arrive.
<?php
/**
Amazon Seller Central Order Notifier
Send me a "push" notification for new orders (after polling)
*/
// Disable error reporting for AWS' shitty sdk
error_reporting(E_ALL & ~E_NOTICE);
chdir(dirname(__FILE__));
require_once('.config.inc.php');
@dvnkshl
dvnkshl / example-advanced.html
Last active June 10, 2019 02:28
Commerce.js Checkout (Advanced)
<!---
This is a advanced javascript checkout built with Commerce.js (http://commercejs.com).
Tutorial: Checkout Tutorial (Advanced) - http://commerce.js.com/docs/overview/checkout-tutorial-advanced/
!-->
<html>
<head>
<title>Checkout Tutorial (Advanced)</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.serializeJSON/2.7.2/jquery.serializejson.js"></script>
<script type="text/javascript" src="https://cdn.chec.io/v1/commerce.js"></script>
@cougrimes
cougrimes / NormalizeMktoForms.css
Last active January 17, 2023 19:17
Marketo Form Normalizer--making things actually responsive.
.mktoForm, .mktoForm .mktoFieldWrap, .mktoForm .mktoHtmlText, .mktoForm input, .mktoLogicalField .mktoCheckboxList, .mktoRangeField, .mktoRangeValue {width:100% !important;}
@media only screen and (min-width:480px) {
.mktoFormCol:first-child:nth-last-child(2), .mktoFormCol:first-child:nth-last-child(2) ~ .mktoFormCol {width: 100% !important;}
.mktoFormCol:first-child:nth-last-child(3), .mktoFormCol:first-child:nth-last-child(3) ~ .mktoFormCol {width: 50% !important;}
.mktoFormCol:first-child:nth-last-child(4), .mktoFormCol:first-child:nth-last-child(4) ~ .mktoFormCol {width: 33.3333% !important;}
.mktoFormCol:first-child:nth-last-child(3) ~ .mktoFormCol {padding-left: 0.3em !important;}
}
@media only screen and (max-width:480px) {.mktoFormCol {width:100% !important;}}
.mktoAsterix{display:none !important;}
.mktoForm .mktoGutter {display:none !important;}
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@jsoverson
jsoverson / device.css
Created February 15, 2013 20:06
Quick css hacks to target android/ios
.visible-android {
display:none;
}
.visible-ios {
display:none;
}
.on-device .visible-android, .on-device .visible-android {
display:inherit;
}
.device-ios .visible-android {
@leostratus
leostratus / webkit-pseudo-elements.md
Created September 21, 2012 01:44
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@janogarcia
janogarcia / haml_partials.haml
Created May 3, 2012 11:28
HAML Partials wihout Rails (useful for LiveReload)
/ A simplistic way of loading and rendering HAML partials (header.haml, footer.haml, nav.haml... you name it) without Rails
/ Useful when using tools like LiveReload http://livereload.com/
/ but don't want to configure a web server just to use PHP include/require constructs (discussion http://help.livereload.com/discussions/questions/22-haml-partials)
/ It could be improved/simplified using a helper http://stackoverflow.com/questions/5436769/partial-haml-templating-in-ruby-without-rails/5436973#5436973
/ Check out the Jade version https://gist.github.com/2593727
%html
%body
%header
= Haml::Engine.new(File.read('/path/to/your/partial.haml')).render
@necolas
necolas / README.md
Last active March 28, 2024 20:34
Experimenting with component-based HTML/CSS naming and patterns

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.

Pattern

t-template-name
@peterc
peterc / webloc.rb
Created January 26, 2011 04:19
Basic Ruby code to read and write ".webloc" files (as used on OS X)
# Basic Ruby code to read and write ".webloc" files (as used on OS X)
# Reads both "old" Safari style and newer plist style
# Writes "old" style only
# Works on Ruby 1.9.2 and 1.8.7
require 'plist'
class Webloc
attr_accessor :url