Skip to content

Instantly share code, notes, and snippets.

View ptbrowne's full-sized avatar

Patrick Browne ptbrowne

View GitHub Profile
// ==UserScript==
// @name Ornikar Keyboard Shortcuts
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Add ABCD shortcuts to Ornikar questions
// @author Patrick Browne
// @match https://www.ornikar.com/*
// @grant none
// ==/UserScript==
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine-html.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/boot.min.js'></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.css" />
@ptbrowne
ptbrowne / shortcut-chrome-inspect.md
Last active October 18, 2017 17:36
Shortcut to Chrome Inspect

Chrome has made the path to inspect devices more and more difficult. Now to open the inspect devices tab, as of April 2016 it's Menu > More Devices > Developer Tools > Menu > More Tools > Inspect Devices.

Fortunately there is an easy solution : we can use customize the search engine functionality to add a shortcut via the search bar.

  1. Right click on the search bar, click 'Edit Search Engines'.
  2. At the end of the list you can add a search engine. Name it chrome inspect with the keyword insp and URL : chrome://inspect/#devices.
@ptbrowne
ptbrowne / gist:bc5d875e782b7ca32040
Created January 7, 2016 16:14
bad-itinerary.json
{
"_id": "568e49392da99e28c3842b14",
"archived": false,
"arrival": [
5.378861000000001,
43.2942346
],
"custom": false,
"departure": [
5.386108399999999,
@ptbrowne
ptbrowne / puzzle.py
Created October 1, 2015 16:02
puzzle liseuse
# -*- coding: utf-8 -*-
from copy import deepcopy
from collections import defaultdict, namedtuple, deque
from functools import wraps
class Colors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
@ptbrowne
ptbrowne / swiper-2.4.3.css
Created September 8, 2015 13:37
swiper 2.4.3
/*
* Swiper - Mobile Touch Slider CSS
* http://www.idangero.us/sliders/swiper
*
* Vladimir Kharlampidi, The iDangero.us
* http://www.idangero.us/
*
* Copyright 2012-2013, Vladimir Kharlampidi
* The iDangero.us
* http://www.idangero.us
@ptbrowne
ptbrowne / arrow.svg
Created September 1, 2015 13:25
arrow
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ptbrowne
ptbrowne / iphone.svg
Created August 26, 2015 13:43
iphone path
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ptbrowne
ptbrowne / magic.py
Last active August 29, 2015 14:26
Magic Class
# -*- coding: utf-8 -*-
class MagicType(type):
def __new__(cls, name, bases, attrs):
if name.startswith('None'):
return None
newattrs = dict(attrs)
@ptbrowne
ptbrowne / gist:48ff446551af768f11cc
Created June 5, 2015 12:38
guillotine to canvas
var data = $('#sample_picture').guillotine('getData');
var pic = $('#sample_picture').get(0);
var canvas = $('canvas').get(0);
if (!canvas) {
$('body').append('<canvas/>')
canvas = $('canvas').get(0);
}
var src = pic.src;
var newPic = new Image();