Skip to content

Instantly share code, notes, and snippets.

View validkeys's full-sized avatar

Kyle Davis validkeys

  • Belongs to one
  • Toronto, ON
View GitHub Profile
<script type="text/javascript">
var _ptq = [];
_ptq.push({
name: "title-of-ad"
});
</script>
<script type="text/javascript" src="http://cdn.pressly.com/ads/pressly-ad-snippet.v3.1.js"></script>
<html>
<head>
<title>Big Data</title>
</head>
<body>
<!-- This is a proxy redirect idea: -->
<!-- 1. Prepend all links in the XML Pressly feeds with http://whateverurl.com?destination= -->
<!-- 2. This page would live at whateverurl.com -->
<!-- 3. We load the tracking pixel below and set a timeout before redirecting the user to ?destination=[DOUBLICK_DESTINATION_URL] -->
class CustomRegion.NotificationRegion extends Marionette.Region
constructor: ->
Marionette.Region.prototype.constructor.apply(@, arguments)
@ensureEl()
@$el.on "hidden", {region: @}, (event) ->
event.data.region.close()
@validkeys
validkeys / gist:6580200
Created September 16, 2013 12:41
htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
RewriteRule .* - [env=HTTP_KUSH_KEY:%{HTTP:X-KUSH-KEY},last]
</IfModule>
<IfModule mod_headers.c>
SetEnvIf Origin "http(s)?://(www\.)?(localhost:8888|localhost:9000|kyle.local:8888|kyle.local:9000|kyleair.local:9000|src.cdn.kushapp.com.s3.amazonaws.com)$" AccessControlAllowOrigin=$0$1
# backbone/entities/user.js.coffe
@Aplat.module "Entities", (Entities, App, Backbone, Marionette, $, _) ->
class Entities.User extends Entities.Model
class Entities.Users.Collection extends Entities.Collection
model: Entities.User
API =
# View:
@Aplat.module "CommandCenterApp.Show", (Show, CommandCenterApp, Backbone, Marionette, $, _) ->
class Show.CommandCenter extends App.Views.ItemView
template: "command_center/show/templates/_command_center"
tagName: "li"
class Show.CommandCenters extends App.Views.CollectionView
template: 'command_center/show/templates/command_center'
class ApplicationController < ActionController::Base
protect_from_forgery with: :null_session
before_filter :authenticate
after_filter :test
serialization_scope :view_context
protected
def current_user
Tracker.prototype.transport = function(data) {
var defer;
defer = $.Deferred();
switch (data.type) {
case "clickthrough":
/*
EYE RETURN -- THIS IS A CLICKTHROUGH
YOU CAN ACCESS THE ID OF THE EVENT VIA data.id
*/
#!/usr/local/bin/ruby -w
require 'csv'
require 'iconv' unless String.method_defined?(:encode)
## THE MAIN FILE TO IMPORT FROM
CSV_FILE_PATH = File.join(File.dirname(__FILE__), "eloqua_20140130.csv")
## THE BASE NAME AND LOCATION OF EXPORT FILES
// this is my goal JSON output
{
post:{
...
comments: [1,2,3]
},
comments:[{
comment:{
...