Skip to content

Instantly share code, notes, and snippets.

View pypetey's full-sized avatar

Piotr Siemieniak pypetey

View GitHub Profile
1. My input is:
https://www.youtube.com/watch?v=6qNW7yRsqAM
Result is:
<iframe width="480" height="270" frameborder="0" allowfullscreen="" src="http://www.youtube.com/embed/6qNW7yRsqAM?feature=oembed"></iframe>
# Code
def get_description(self):
providers = micawber.bootstrap_basic()
description = bleach.clean(self.description)
HTML:
<div style="padding-left: {{(subItem.level -1) * 25}}px">
<input type="checkbox" name="submissiongroup" ng-change="selectCheckbox(subItem.id)" ng-model="subItem.id" value="subItem.id"/>
{{subItem.name}} ({{subItem.submission_count}})
</div>
JS:
var module = angular.module("submissionDashboard", ['ui.tree', 'ngCookies',]);
@pypetey
pypetey / gist:724774df3fc4d3388e3c
Created June 27, 2014 08:16
Periodically update time when element was added with moment.js
<script type="text/javascript">
$(document).ready(function() {
var update = function() {
$('time').each(function() {
date = moment(new Date($(this).attr("datetime")));
$(this).html(date.fromNow());
});
};
update();
setInterval(update, 1000 * 60);