Skip to content

Instantly share code, notes, and snippets.

View jfeldstein's full-sized avatar

Jordan Feldstein jfeldstein

View GitHub Profile
@jfeldstein
jfeldstein / gist:1fc68d153a7ed0d63baf
Last active August 29, 2015 14:18
DKIM and SPF Instructions for Marketo Customers

Sending @YourDomain.com Email, From Marketo

Before we can send email on your behalf, using your own domain, we need you to set up the correct DKIM and SPF Records which are the internet's way of signing that an email is being sent from an authorized source.

DKIM and SPF Records are special "TXT"-type DNS records set on your domain, and defined in a way that securely give authority to another server to send email from your domain.

What are DNS Records?

If you don't know what DNS records are, you are not the person who should be following this guide. Please find someone who can manage your company's domains' DNS, and give them the following instructions.

@jfeldstein
jfeldstein / keybase.md
Created December 29, 2014 23:55
keybase.md

Keybase proof

I hereby claim:

  • I am jfeldstein on github.
  • I am jfeldstein (https://keybase.io/jfeldstein) on keybase.
  • I have a public key whose fingerprint is 66F9 EA61 B4B5 F69B 1CB5 94F4 F20D E6A9 02F8 F1E3

To claim this, I am signing this object:

class Person < ActiveRecord::Base
has_and_belongs_to_many :scrapers
default_scope lambda { where :downloaded_at => nil }
def self.queued_for_download
with_exclusive_scope{Person.where{downloaded_at>3.seconds.ago}}
end
end
ActiveAdmin.register Person do
index :download_links => false do
column :name
column :primary_email
column :phone
column :zip
column :service
column :vertical
column :age
end
@jfeldstein
jfeldstein / jQuery.GetUrlVar
Created June 26, 2014 03:01
`$.getUrlVar('foo');` == 'bar' for url.com?foo=bar
<script>
// To convert it to a jQuery plug-in, you could try something like this:
(function($){
$.getUrlVar = function(key){
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search);
return result && unescape(result[1]) || "";
};
})(jQuery);
</script>
@jfeldstein
jfeldstein / Gruntfile.with-phonegap.js
Created December 6, 2013 02:16
How to modify the default Gruntfile generated by generator-backbone to support building assets into a Phonegap app nested inside the project.
// ...
module.exports = function (grunt) {
// ...
// configurable paths
var yeomanConfig = {
app: 'app',
dist: 'dist',
phonegap: 'phonegap/www'
@jfeldstein
jfeldstein / Parse-Gotchas.coffee
Last active December 30, 2015 07:09
List of gotchas for dealing with "bugs" in Parse's javascript SDK
## Fetch related when fetching
fetch: (options) ->
console.log("Fetching order")
# Does not work when order is created by rotateOrder, and does not have an .id specified.
(OrderModel.__super__.fetch.apply(this, [])).then =>
@fetch_related().then ->
options.success() if options.success?
@jfeldstein
jfeldstein / gist:7149939
Created October 25, 2013 05:47
Charts, mah dog.
<html>
<head>
<script src="./js/jquery.js"></script>
<script src="./js/underscore.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/funnel.js"></script>
<script type="text/javascript" src="http://www.highcharts.com/highslide/highslide-full.min.js"></script>
<script type="text/javascript" src="http://www.highcharts.com/highslide/highslide.config.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="http://www.highcharts.com/highslide/highslide.css" />
@jfeldstein
jfeldstein / get_campaigns.js
Created August 2, 2013 20:55
Persistent referrer and UTM campaign tracking for Segment.io
getReferrerTraits = function() {
// Requires: jQuery, jQuery.cookie, segment.io
// TODO: Update referralHost:blackList with your domain, so we only track external referrers.
var analytics_args = [],
analytics_traits,
acquisitionSource,
firstReferrer,
firstCampaign,
@jfeldstein
jfeldstein / application.js
Last active December 17, 2015 14:39
Tracking an event with Segment IO, and displaying a chart of each user's usage stats to that user.
// Add the following line:
//= require ./keentivate/index.js
// Before the line:
//= require_tree .