Skip to content

Instantly share code, notes, and snippets.

Avatar
🍊

Lauren Lee McCarthy lmccart

🍊
View GitHub Profile
View gist:5073710
$.ajax({
url: 'http://godseyes.nodejitsu.com/enter_random_session/',
type: 'GET',
dataType: "json",
success: function(data) { console.log("data = "+data); },
error: function (xhr, err) {
console.log("readyState: " + err + xhr.readyState + "\nstatus: " + xhr.status);
console.log("responseText: " + xhr.responseText);
}
View gist:5461957
// Defines common functionality for toggleable components and components that
// may require the selection of files and folders.
//
// This view is intended to be extended (`ComponentBaseView.extend({...})`)
// rather than used directly.
define(['underscore', 'jquery', 'backbone', 'views/modal',
'collections/folders', 'collections/files', 'models/file',
'text!templates/component-toggle.html',
'text!templates/component-manage-files.html',
'text!templates/component-folder-modal.html',
View gist:5461962
// Defines common functionality for toggleable components and components that
// may require the selection of files and folders.
//
// This view is intended to be extended (`ComponentBaseView.extend({...})`)
// rather than used directly.
define(['underscore', 'jquery', 'backbone', 'views/modal',
'collections/folders', 'collections/files', 'models/file',
'text!templates/component-toggle.html',
'text!templates/component-manage-files.html',
'text!templates/component-folder-modal.html',
View gist:5646852
var values = {
radius: 40,
opacity: 1,
color: 'red',
animate: false
};
var components = {
View gist:5952806
Quad Quad::getCenteredFit(const Quad &other, bool expand) const
{
Quad result = *this;
result.offset( other.getCenter() - result.getCenter() );
bool isInside = ( ( result.getWidth() < other.getWidth() ) && ( result.getHeight() < other.getHeight() ) );
if( expand || !isInside ) { // need to do some scaling
float aspectAspect = result.getAspectRatio() / other.getAspectRatio();
if( aspectAspect >= 1.0f ) { // result is proportionally wider so we need to fit its x-axis
float scaleBy = other.getWidth() / result.getWidth();
View gist:6073695
~/Documents/soso/IHR/iHeartRadio-CMS⚡ shovel db_reset
Traceback (most recent call last):
File "/Users/lmccart/Documents/soso/IHR/iHeartRadio-CMS/backend/.env/bin/shovel", line 98, in <module>
task(*args, **kwargs)
File "/Users/lmccart/Documents/soso/IHR/iHeartRadio-CMS/backend/.env/lib/python2.7/site-packages/shovel/__init__.py", line 232, in __call__
args, kwargs = arg.getArgs()
File "/Users/lmccart/Documents/soso/IHR/iHeartRadio-CMS/backend/.env/lib/python2.7/site-packages/shovel/__init__.py", line 103, in getArgs
name, value = pair
ValueError: too many values to unpack
View gist:6108616
mov: {u'streams': [{u'sample_aspect_ratio': u'1:1', u'codec_type': u'video', u'bit_rate': u'112726985', u'codec_name': u'prores', u'duration': u'15.765750', u'nb_frames': u'378', u'codec_time_base': u'1/24000', u'index': 0, u'start_pts': -14, u'disposition': {u'comment': 0, u'forced': 0, u'lyrics': 0, u'default': 0, u'visual_impaired': 0, u'dub': 0, u'karaoke': 0, u'clean_effects': 0, u'attached_pic': 0, u'original': 0, u'hearing_impaired': 0}, u'width': 1920, u'pix_fmt': u'yuv422p10le', u'tags': {u'timecode': u'00:00:00:00', u'handler_name': u'Apple Alias Data Handler', u'creation_time': u'2013-07-29 20:59:47', u'language': u'eng'}, u'r_frame_rate': u'24000/1001', u'start_time': u'-0.000583', u'time_base': u'1/24000', u'codec_tag_string': u'apcn', u'duration_ts': 378378, u'codec_long_name': u'ProRes', u'display_aspect_ratio': u'16:9', u'codec_tag': u'0x6e637061', u'height': 1080, u'avg_frame_rate': u'24000/1001', u'level': -99, u'has_b_frames': 0}, {u'sample_fmt': u's16', u'bits_per_sample': 16, u'codec_type
View gist:6118358
scales[i] = Math.pow(2 * Math.abs(balances[i] - .5), scalePower);
scales[i] = map(scales[i], 0, 1, minHeightScale, maxHeightScale);
totalScale += scales[i];
if(scales[i] > maxScale) {
maxScale = scales[i];
maxScaleIndex = i;
}
View gist:6321677
File "/Sosolimited/iHeartRadio/Software/iHeartRadio-CMS/backend/.env/lib/python2.7/site-packages/amqp/connection.py", line 136, in _init_
self.transport = create_transport(host, connect_timeout, ssl)
File "/Sosolimited/iHeartRadio/Software/iHeartRadio-CMS/backend/.env/lib/python2.7/site-packages/amqp/transport.py", line 244, in create_transport
return TCPTransport(host, connect_timeout)
File "/Sosolimited/iHeartRadio/Software/iHeartRadio-CMS/backend/.env/lib/python2.7/site-packages/amqp/transport.py", line 89, in _init_
raise socket.error, msg
error: [Errno 61] Connection refused
<Greenlet at 0x103a6c2d0: check_for_tweets(True, <__main__.Publisher object at 0x103a58c10>)> failed with error
blah blah blah - but no rabbit running
View gist:7105670
exports.loadJSON = function(file, callback) {
var req = new XMLHttpRequest();
req.overrideMimeType('application/json');
req.open('GET', 'data/'+file);
req.onreadystatechange = function () {
if(req.readyState === 4) {
if(req.status === 200 || req.status == 0) {
if (typeof callback !== 'undefined') callback();
console.log(req.responseText);
return JSON.parse(req.responseText);