Skip to content

Instantly share code, notes, and snippets.

// https://example.com/index.html
$('#fileupload').fileupload({
url: 'https://apiexample.com/upload/image/',
dataType: 'text',
paramName: 'file',
redirect: 'https://example.com/result.html?%s',
add: function (event, data) {
// Start upload
data.submit();
import DS from 'ember-data';
import config from '../config/environment';
export default DS.LSAdapter.extend({
namespace: config.modulePrefix
});
@jpadilla
jpadilla / gist:70dfc69a404ad302d44d
Last active August 29, 2015 14:06
Restart all your Heroku apps to receive the updated stack image that patches CVE-2014-6271, also known as "shellshock". https://status.heroku.com/incidents/665
for app in $(heroku apps|sed -n '/^=== My Apps/,/patterns/{s/^=== My Apps//;/^patterns/d;p;}'); do echo "===> Restarting $app..."; heroku ps:restart --app $app; done
class Course(models.Model):
name = models.CharField(max_length=255)
class Teacher(models.Model):
name = models.CharField(max_length=255)
courses = models.ManyToManyField(Course)
class M2MDjangoFilterBackendTests(TestCase):
@jpadilla
jpadilla / gist:6dd7810697a49187a499
Last active August 29, 2015 14:05
Barrandiando endpoints