This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nose.tools import set_trace | |
set_trace() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var delta; | |
var currentSlideIndex = 0; | |
function elementScroll (e) { | |
// --- Scrolling up --- | |
if (e.originalEvent.detail < 0 || e.originalEvent.wheelDelta > 0) { | |
delta--; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Helper method to determine the filename from the URL | |
* @param {url} the path to match | |
* @return {String} the path for caching | |
**/ | |
function getFilenameFromUrl(url){ | |
var path = url.substring(path.lastIndexOf("/")+ 1); | |
return (path.match(/[^.]+(\.[^?#]+)?/) || [])[0]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var urlToCheck = 'https://deanhume.github.io/beer' + createStyleUrl(styleId, pageId, false); | |
/** | |
* Display the offline notification. | |
* @return {void} | |
**/ | |
function showOfflineNotification() { | |
// return if there is no service worker | |
if (!'serviceWorker' in navigator) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var delta; | |
dragThreshold = 0.15;// "percentage" to drag before engaging | |
dragStart = null; // used to determine touch / drag distance | |
percentage = 0, | |
target, | |
previousTarget; | |
function touchStart(event) { | |
if (dragStart !== null) { return; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import code; code.interact(local=dict(globals(), **locals())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in proximanova-*-webfont.*; do mv $i $(echo $i | sed 's/proxima-//g' | sed 's/-webfont//g'); done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def quick_sort(lst): | |
if len(lst) <= 1: | |
return lst | |
low, middle, high = [], [], [] | |
pivot = lst[0] | |
for num in lst: | |
if num < pivot: | |
low.append(num) | |
elif num > pivot: | |
high.append(num) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def merge(arr, arr_ptr, half, half_ptr): | |
while half_ptr < len(half): | |
arr[arr_ptr] = half[half_ptr] | |
half_ptr = half_ptr + 1 | |
array_ptr = array_ptr + 1 | |
return array_ptr | |
def merge_sort(arr): | |
print("Splitting ", arr) | |
if len(arr) > 1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
multipliers = (1..9) | |
multipliers.each do |x| | |
print multipliers.map {|y| | |
s = y * x | |
"#{s < 10 ? ' ' : ''}#{s}" | |
}.join(' ') | |
print "\n" | |
end |
NewerOlder