Skip to content

Instantly share code, notes, and snippets.

View seb-thomas's full-sized avatar
:octocat:

Sebastian Thomas seb-thomas

:octocat:
View GitHub Profile
{"msg": "1 item was added to your basket", "item": {"original_price": "60.00", "name": "era ca", "url": "/store/product/vans-era-ca-trainers-VN-0IM96GW", "brand": "Vans", "qty": 1, "selling_price": "60.00", "thumb_url": ""}, "cart_total": "420.00", "cart_item_count": 7}
In [2]: run image_script.py
File "<ipython-input-2-f82209390f2b>", line 1
run image_script.py
^
SyntaxError: invalid syntax
In [3]: run image_script
File "<ipython-input-3-556c636d0b48>", line 1
run image_script
@seb-thomas
seb-thomas / gist:4976998
Created February 18, 2013 12:24
date swap gist
var myRe = /(\d+)\/(\d+)\/(\d+)/;
('15/02/2013 05:12 pm').replace(myRe, "$3/$2/$1");
"2013/02/15 05:12 pm"
@seb-thomas
seb-thomas / updated?
Created February 18, 2013 16:29
Some js to help us see if a page has been updated while we've been staring at it like zombied smack addicts.
var YOUR_API_KEY = ''
var dateUpdated = "";
function changeTitle() {
var favi = jQuery('[rel="shortcut icon"]');
var titleDate = jQuery('p.author a').last().attr('title');
var reDate = /(\d+)\/(\d+)\/(\d+)/;
//Swap year and day, convert to Date obj
titleDate = (titleDate).replace(reDate, "$3/$2/$1");
@seb-thomas
seb-thomas / update
Last active December 13, 2015 21:38 — forked from tomviner/updated?
var dateUpdated = "";
var reDate = /(\d+)\/(\d+)\/(\d+)/;
var titleDate = jQuery('p.author a').last().attr('title');
var favi = jQuery('[rel="shortcut icon"]');
//Swap year and day, convert to Date obj
titleDate = (titleDate).replace(reDate, "$3/$2/$1");
titleDate = new Date(titleDate);
function changeTitle() {
jQuery.get(
@seb-thomas
seb-thomas / gist:4984941
Last active December 13, 2015 22:29
Redmine issue updated?
if(typeof jQuery !== 'undefined'){
jQuery(function($) {
var dateUpdated = "";
var reDate = /(\d+)\/(\d+)\/(\d+)/;
var reIssues = /issues\/\d+/;
var titleDate = $('p.author a').last().attr('title');
var style= 'position: fixed;bottom: 0px;margin-bottom: 0px;width: 100%;padding: 12px 0px 13px 30px;background-position-y: 12px;';
var warning = '<div class="flash warning" style="'+style+'">This issue has been updated since you last saw it. <a href="javascript:location.reload(true);">Refresh now</a></div>';
@seb-thomas
seb-thomas / gist:5154064
Created March 13, 2013 16:57
errrroorrr
Requirement already satisfied (use --upgrade to upgrade): e==1.3 in /home/seb/.virtualenvs/defected/lib/python2.7/site-packages (from -r requirements.txt (line 3))
Downloading/unpacking docutils (from -r requirements.txt (line 4))
Downloading docutils-0.10.tar.gz (1.6MB): 684kB downloaded
Exception:
Traceback (most recent call last):
File "/home/seb/.virtualenvs/defected/local/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/basecommand.py", line 107, in main
status = self.run(options, args)
File "/home/seb/.virtualenvs/defected/local/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/commands/install.py", line 256, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/home/seb/.virtualenvs/defected/local/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 1018, in prepare_files
var notSelected = $('.field-size').find("select option:selected");
$(notSelected).each(function() {
if ($(this).text().match(/---------/)){
$(this).addClass("hidden");
}
});
class Box(BaseModel):
BLACK, WHITE = 0, 1
BLACK_N_WHITE = (
(BLACK, 'black'),
(WHITE, 'white'),
function setClicker() {
var arrowClicker = $('.direction-arrows');
}
$('.direction-arrows').click( function(event){
var link = $(this).attr('href');
var elem = $('.video_thumbnails_wrapper');
console.log(link);
elem.load(link +' .video_thumbnails_wrapper', function(response, status, xhr) {
if (status == "error") {