Skip to content

Instantly share code, notes, and snippets.

@ryanburnette
ryanburnette / header.html
Last active August 29, 2015 13:55
Two versions of jQuery in a restrictive situation.
<!-- At this point our environmental jQuery should have already loaded, we'll
assign it to a separate variable on the window and delete the dollar sign -->
<script>
window.jQuery142 = window.jQuery;
delete window.$;
</script>
<!-- Next, we'll load our next version of jQuery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
// Jekyll Pygments syntax highlighter styles
// Colors
$default: #FFFFFF
$background: #010101
$comment: #586E75
$error: #586E75
$generic: #93A1A1
$keyword: #859900
$literal: #93A1A1
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json')
, coffeelint: {
app: ['./assets/javascripts/**/*.coffee']
}
require 'net/http'
require 'uri'
require 'json'
class FacebookFetchShareCount
attr_accessor :uri
attr_reader :shares
def initialize(uri)
@uri = uri
# http://stackoverflow.com/a/1252305/2535178
def get_with_params(domain,path,params)
res = Net::HTTP.get(domain, "#{path}?".concat(params.collect { |k,v| "#{k}=#{CGI::escape(v.to_s)}" }.join('&'))) if not params.nil?
end
@ryanburnette
ryanburnette / gf_action.php
Created May 3, 2014 13:41
Add additional actions to a Gravity Forms submission in WordPress.
<?php
function do_something_else($entry, $form) {
// Gravity Forms has validated the data
// Our Custom Form Submitted via PHP will go here
}
add_action("gform_post_submission", "do_something_else", 10, 2);
def slugify(text)
text.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
end
(function () {
var e
, s
, src = '//example.com/example.js'
;
e = document.createElement('script');
e.async = true;
e.type='text/javascript';
e.src = src;
if ( $http_origin ~ "mydomain.com$" ) {
add_header "Access-Control-Allow-Origin" $http_origin;
}