Skip to content

Instantly share code, notes, and snippets.

(function(global, $){
var YoutubeVideo = function(options) {
var self = this;
if (!options.id || typeof options.container.jquery === 'undefined') {
return false;
}
self.videoId = options.id;
@tomasdev
tomasdev / app.js
Created March 6, 2013 05:51
Ember Handlebars external templates
// Taken from http://stackoverflow.com/questions/10274391/is-it-possible-to-load-handlebar-template-with-script-tag-or-define-handlebar-t/13474886#13474886
Ember.View.reopen({
templateForName: function(name, type) {
if (!name) { return; }
var templates = Ember.get(this, 'templates'),
template = Ember.get(templates, name);
if (!template) {
$.ajax({
@tomasdev
tomasdev / example.md
Last active December 15, 2015 14:58
...

Title of the post

This is a sample post. Here should go the post content

Little Cat or use direct HTML such as:

@tomasdev
tomasdev / gist:5864017
Last active July 6, 2017 00:55
Fix for Aurora Star Tumblr theme like button not working

This guide is particularly dedicated to @airaburabu

  1. Go to your Tumblr's customization panel (default at http://www.tumblr.com/customize)
  2. Click on Edit HTML
  3. Look up for
<a class="like item" onclick="LikePost('{PostID}','{ReblogURL}',this); $(this).css('background-image', 'url(http://assets.tumblr.com/images/iframe_like_active_alpha.png)')"></a><a href="{ReblogURL}?redirect_to=http%3A%2F%2F{Name}.tumblr.com%2Fpage%2F{CurrentPage}" class="reblog item" target="_blank"></a>

And replace it with:

{LikeButton size="12" color="white"}
@tomasdev
tomasdev / 4sq-names.js
Created July 13, 2013 20:52
Get all Foursquare categories with jQuery
var parse = function (categories) {
categories.forEach(function (category) {
if (category.categories && category.categories.length) {
console.group(category.name);
parse(category.categories);
console.groupEnd(category.name);
} else {
console.log(category.name);
}
});
{
"bold_folder_labels": true,
"font_size": 12.0,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"tab_size": 4,
"theme": "Soda Dark.sublime-theme",
@tomasdev
tomasdev / RegEx
Created August 14, 2013 20:56
Detect mobile user agent.
/(alcatel|amoi|android|avantgo|blackberry|benq|cell|cricket|docomo|elaine|htc|iemobile|iphone|ipad|ipaq|ipod|j2me|java|midp|mini|mmp|mobi|motorola|nec-|nokia|palm|panasonic|philips|phone|playbook|sagem|sharp|sie-|silk|smartphone|sony|symbian|t-mobile|telus|up\.browser|up\.link|vodafone|wap|webos|wireless|xda|xoom|iPhone)/i
@tomasdev
tomasdev / jsbin.uJAH.css
Last active December 21, 2015 15:19
Page cube flipping effect taken from https://github.com/codrops/PageTransitions
/* General Demo Style */
@import url(http://fonts.googleapis.com/css?family=Lato:300,400,700|Satisfy);
*, *:after, *:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
body, html { font-size: 100%; padding: 0; margin: 0;}
body {
font-family: 'Lato', Calibri, Arial, sans-serif;
color: #fff;
background: #333;
@tomasdev
tomasdev / git-notes.md
Created December 23, 2013 14:38
Renaming branches in Git.

References:

  • to_be_deleted BRANCH NAME TO BE DELETED
  • new_name NEW BRANCH NAME

SOMEONE

  1. Rename the branch locally git branch -m to_be_deleted new_name
  2. Push it to the remote git push origin new_name
// LikePhoto.js
exports.main = function(request, response){
var query = new Parse.Query("Photo");
var objid = request.params.objectid;
return query.get(objid)
// Photo
.then(function(photo) {