This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with | |
dau as ( | |
-- This part of the query can be pretty much anything. | |
-- The only requirement is that it have three columns: | |
-- dt, user_id, inc_amt | |
-- Where dt is a date and user_id is some unique identifier for a user. | |
-- Each dt-user_id pair should be unique in this table. | |
-- inc_amt represents the amount of value that this user created on dt. | |
-- The most common case is | |
-- inc_amt = incremental revenue from the user on dt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- invoices | |
SELECT | |
u.id AS user_id, | |
uuid_timestamp(i.id)::DATE AS dt, | |
sum(i.balance) AS inc_amt | |
FROM public.users u | |
JOIN public.invoices i ON u.id = i.user_id | |
WHERE | |
u.fraud_score != 'F' | |
AND uuid_timestamp(i.id) > DATE '2015-06-30' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert an animated video to gif | |
# Works best for videos with low color palettes like Dribbble shots | |
# | |
# @param $1 - video file name like `animation.mov` | |
# @param @optional $2 - resize parameter as widthxheight like `400x300` | |
# | |
# Example: vidtogif animation.mov 400x300 | |
# Requirements: ffmpeg and gifsicle. Can be downloaded via homebrew | |
# | |
# http://chrismessina.me/b/13913393/mov-to-gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (grunt)-> | |
# Run `grunt server` for live-reloading development environment | |
#grunt.registerTask('server', [ 'build', 'livereload-start', 'karma:background', 'express', 'regarde' ]) | |
grunt.registerTask('server', [ 'build', 'express', 'watch' ]) | |
# Run `grunt test` (used by `npm test`) for continuous integration (e.g. Travis) | |
grunt.registerTask('test', [ 'build', 'karma:unit' ]) | |
# Run `grunt test:browsers` for real-world browser testing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You can do that in your Chrome Console | |
// Load the initial object, like an Attempt | |
var attempt = new Parse.Object("Attempt"); | |
attempt.id = "myId"; | |
attempt.fetch(); | |
// Get the relation "handler" from the attempt object | |
var relation = attempt.relation("products"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
info: Creating snapshot 0.0.1-22 | |
info Uploading: [=============================] 100% | |
info: Updating app shinobi | |
error: Error running command deploy | |
error: Nodejitsu Error (500): Internal Server Error | |
warn: Error returned from Nodejitsu | |
error: Error: App domain already exists | |
error: at module.exports.show.updateCounts.(anonymous function).updateCounts.(anonymous function) (/root/nodejitsu/lib/nodejitsu/resources/app/controller/update.js:89:28) | |
error: at Resource._request (/root/nodejitsu/node_modules/resourceful/lib/resourceful/resource.js:184:13) | |
error: at Function.Resource.runAfterHooks (/root/nodejitsu/node_modules/resourceful/lib/resourceful/resource.js:93:12) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crypto = require('crypto') | |
, uuid = require('node-uuid'); | |
function recurly () { | |
} | |
recurly.prototype.sign = function (privateKey, params) { | |
var protectedString = makeProtectedString(params); | |
var secureHash = makeHash(privateKey, protectedString); | |
var signature = secureHash+"|"+protectedString; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FB.getLoginStatus(function(response) { | |
if (response.status === 'connected') { | |
alert("yes am connected"); | |
} else if (response.status === 'not_authorized') { | |
alert("logged into facebook but not authorized your app"); | |
} else { | |
alert("not logged into facebook"); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NEW ACCOUNT NOTIFICATION | |
<?xml version="1.0" encoding="UTF-8"?> | |
<new_account_notification> | |
<account> | |
<account_code>[email protected]</account_code> | |
<username nil="true"></username> | |
<email>[email protected]</email> | |
<first_name>a</first_name> | |
<last_name>a</last_name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NB: this is being generated by the server side MVC, so url is brandid.macbook.pro/male | |
<!-- deleted lots of header stuff --> | |
<body> | |
<div id="maleContainer" class="container withShadow"> | |
<div class="maleApp" ng-app="ngMaleApp"> | |
<div class="content" ng-view> | |
</div> |
NewerOlder