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
| """ | |
| Here's my sample Django settings for a project I recently did. Visit http://damonjablons.wordpress.com to see the explanation. | |
| """ | |
| import os | |
| import socket | |
| # Set DEBUG = True if on the production server | |
| if socket.gethostname() == 'your.domain.com': | |
| DEBUG = 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
| spoof@mac:~% brew install -vd mc | |
| ==> Build Environment | |
| CC: /usr/bin/cc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 | |
| CXX: /usr/bin/c++ => /usr/bin/c++-4.2 | |
| LD: /usr/bin/cc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 | |
| CFLAGS: -O3 -march=core2 -msse4.1 -w -pipe | |
| CXXFLAGS: -O3 -march=core2 -msse4.1 -w -pipe | |
| MAKEFLAGS: -j2 | |
| ==> Downloading http://www.midnight-commander.org/downloads/mc-4.7.4.tar.bz2 | |
| File already downloaded and cached to /Users/spoof/Library/Caches/Homebrew |
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
| spoof@spoofs-mac:tests% python test_filter.py | |
| list comprehension 0.0898420810699 | |
| filter lambda 0.104062080383 | |
| filter None 2.14576721191e-06 | |
| -------------------- | |
| def list_comprehension(data): | |
| return [x for x in data if x] | |
| 17 0 BUILD_LIST 0 | |
| 3 LOAD_FAST 0 (data) |
This file has been truncated, but you can view the full file.
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
| nomn gent accs loct | |
| --------------------------- --------------------------- --------------------------- --------------------------- | |
| москва москвы москву москве | |
| абрамцевое абрамцевого абрамцевое абрамцевом | |
| алабино алабина алабино алабине | |
| апрелевка апрелевки апрелевку апрелевке | |
| архангельское архангельского архангельское архангельском | |
| ашитковое ашиткового ашитковое ашитковом | |
| байконур байконура байконур байконуре |
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
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(query_start, clock_timestamp()), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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 ( | |
| "net/http" | |
| "database/sql" | |
| "fmt" | |
| "log" | |
| "os" | |
| ) |
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
| sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist | |
| sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist |
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
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| import XCPlayground | |
| // MARK: - Helpers | |
| extension UIView { | |
| func addBorderWith(color: UIColor, width: CGFloat, alpha: CGFloat = 1) { | |
| self.layer.borderColor = color.colorWithAlphaComponent(alpha).CGColor |
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
| """ | |
| Transforms a normal Python file to pep484 annotations using Jedi. | |
| Usage: | |
| pep484transform.py <file> [-d] | |
| Options: | |
| -d, --debug Show Jedi's debug output. | |
| """ | |
| from os.path import abspath |
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
| from django.test import TestCase | |
| class ReceiverConnectionTestCase(TestCase): | |
| """TestCase that allows asserting that a given receiver is connected to a signal. | |
| Important: this will work correctly providing you: | |
| 1. Do not import or patch anything in the module containing the receiver in any django.test.TestCase. | |
| 2. Do not import (except in the context of a method) the module containing the receiver in any test module. | |
OlderNewer