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 Logger = (function() { | |
return { | |
active: true, | |
post: false, | |
log: function(obj, type) { | |
if(Logger.active) { | |
console.log(obj); | |
} | |
if(Logger.post) { | |
$.post(Logger.post, { |
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
$.fn.inputPlaceholder = function(options){ | |
return $(this).each(function() { | |
var options = jQuery.extend({ | |
text: $(this).attr('placeholder') | |
},options); | |
if($(this).val() == '') { | |
$(this).val(options.text); | |
} | |
$(this) |
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 urlParams = (function () { | |
var _params={}, | |
e, | |
a = /\+/g, // Regex for replacing addition symbol with a space | |
r = /([^&=]+)=?([^&]*)/g, | |
d = function (s) { return decodeURIComponent(s.replace(a, " ")); }, | |
q = window.location.search.substring(1); | |
while (e = r.exec(q)) { | |
_params[d(e[1])] = d(e[2]); |
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
Show hidden characters
[ | |
{ | |
"class": "label_control", | |
"color": [255, 255, 255], | |
"shadow_color": [24, 24, 24], | |
"shadow_offset": [0, -1] | |
}, | |
{ | |
"class": "button_control", | |
"content_margin": [6, 5, 6, 6], |
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
$.fn.isOnScreen = function(){ | |
var win = $(window); | |
var viewport = { | |
top : win.scrollTop(), | |
left : win.scrollLeft() | |
}; | |
viewport.right = viewport.left + win.width(); | |
viewport.bottom = viewport.top + win.height(); | |
var bounds = this.offset(); |
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
angular.module('OnShow', []). | |
directive('onShow', function () { | |
return { | |
controller: function($scope) { | |
$scope.fireOnce = false; | |
this.setFireOnce = function(bool) { | |
$scope.fireOnce = bool; | |
} | |
}, | |
link: function(scope, elm, attr) { |
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
https://jsfiddle.net/#&togetherjs=15bbxQITu0 |
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
import premailer | |
def parse_template_tags(input_str): | |
""" Premailer encodes paths in the src attribute of images, so we have to swap them out w original values here """ | |
mapping = ( | |
('%7B%7B%20', '{{ '), ('%20%7D%7D', ' }}'), | |
('%7B%7B', '{{ '), ('%7D%7D', ' }}'), | |
) | |
for k, v in mapping: |
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
import React, { Component } from 'react'; | |
import './App.css'; | |
class App extends Component { | |
render() { | |
return ( | |
<TodoList /> | |
) | |
} | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Simple XHR Example</title> | |
<script type="text/javascript"> | |
function reqListener () { | |
var jsonResponse = JSON.parse(this.responseText); | |
var characters = jsonResponse.data.results; |
OlderNewer