This file contains hidden or 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
# coding: utf-8 | |
# Lidt data at lege med | |
letters = ['a', 'b', 'c', 'd', 'e'] | |
numbers = range(5) | |
products = [{'name': 'Product 1', 'size': 'Large'}, | |
{'name': 'Product 2', 'awesome': True}] | |
class Product(object): |
This file contains hidden or 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
# coding: utf-8 | |
def func0(a, b, c): | |
print "func0" | |
print "a", a, "b", b, "c", c | |
func0('a', 'b', 'c') |
This file contains hidden or 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
function detect_card_type(card_number) { | |
if (!_.isString(card_number) || _.isEmpty(card_number.trim())) { | |
return null; | |
} | |
c = card_number.trim(); | |
// http://en.wikipedia.org/wiki/List_of_Issuer_Identification_Numbers | |
if (/^[1-2]/.test(c)) return 'airline'; | |
if (/^3[06]/.test(c)) return 'diners'; | |
if (/^3[47]/.test(c)) return 'amex'; |
This file contains hidden or 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
if (expiry_month.length == 1) { | |
expiry_month = '0' + expiry_month; | |
$('.card-expiry-month').val(expiry_month); | |
} | |
if (expiry_year.length == 2) { | |
expiry_year = '20' + expiry_year; | |
$('.card-expiry-year').val(expiry_year); | |
} |
This file contains hidden or 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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
type DatetimeCondition struct { | |
From *float32 | |
To *float32 |
This file contains hidden or 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
upstream qrr_app { | |
server 127.0.0.1:8080 fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name app.qrr.dk; | |
keepalive_timeout 5; |
This file contains hidden or 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
# /etc/nginx/sites-enabled/magento | |
server { | |
listen 80; | |
server_name ec2-184-72-68-219.compute-1.amazonaws.com; | |
root /var/www/magento/; | |
access_log /var/log/nginx/magento-access_log; | |
error_log /var/log/nginx/magento-error_log; | |
location / { |
This file contains hidden or 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 side_by_side_simple(items): | |
if max_height(items) > MAX_HEIGHT or max_width(items) > MAX_WIDTH: | |
return False | |
if total_depth(items) <= MAX_DEPTH: | |
return True | |
pairs = permutations(items, 2) | |
stackable_pairs = [] | |
for a, b in pairs: | |
stackable = False |
This file contains hidden or 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 side_by_side_brute(items): | |
# can all the books fit? | |
if max_height(items) > MAX_HEIGHT or max_width(items) > MAX_WIDTH: | |
return False | |
# is the volume ok? | |
if total_volume(items) >= MAX_HEIGHT * MAX_WIDTH * MAX_DEPTH: | |
return False | |
# we are dealing with factorials here... 10! is 3.6 mio options |
This file contains hidden or 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
Package Control: Fetching list of available packages | |
Platform: linux-x64 | |
Sublime Text Version: 3047 | |
Package Control Version: 2.0.0-alpha7 | |
theme loaded | |
Package Control: Unable to find a sublime-package file for SublimeGit | |
Package Control: Unable to find file package-metadata.json in the package SublimeGit | |
Package Control: Download Debug | |
URL: http://release.sublimegit.net/SublimeGit.sublime-package | |
Resolved IP: 192.155.92.235 |
OlderNewer