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" | |
"time" | |
"github.com/kevinburke/twilio-go/token" | |
"github.com/pkg/errors" | |
) |
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 include_parser | |
import ( | |
"regexp" | |
"strings" | |
"errors" | |
"fmt" | |
) | |
var whitespaces = regexp.MustCompile("\\s+") |
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
(() => { | |
let data = []; | |
process.stdin.setEncoding('utf8'); | |
process.stdin.on('data', data.push.bind(data)); | |
process.stdin.on('end', () => { | |
let words = {}; |
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 convert(number, base): | |
result = '' | |
while base < number: | |
number, remainder = divmod(number, base) | |
result = str(remainder) + result | |
return str(number) + result |
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
""" | |
Author: Rinat Khabibiev <[email protected]> | |
Compact indexable version of string column for `sqlalchemy` ORM | |
Uses crc64 hash of string as index value. Supports querying, filtering, | |
model instantiation and assignment | |
Usage example: | |
class User(DeclarativeBase): |
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
3 | |
4 | |
100 | |
100 | |
1000 |
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
<?php | |
/** | |
* Created by PhpStorm. | |
* User: renskiy | |
* Date: 15.02.14 | |
* Time: 19:41 | |
*/ | |
class YmlUpdater { |
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
<?php | |
require('rpn.php'); | |
class RpnTest extends PHPUnit_Framework_TestCase { | |
/** | |
* @dataProvider provider_rpn | |
*/ | |
public function test_rpn($rpn, $expected, $operators='+-/*') { |
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
""" | |
Add support of `optparse.OptionGroup` for Django commands. | |
Example: | |
class MyCommand(AdvancedCommand): | |
option_groups = AdvancedCommand.option_groups + ( | |
make_option_group( | |
'Option group title', |
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
""" | |
Adds `select_for_update()` method to Django QuerySet (Django < 1.4). | |
Usage: | |
class MyModel(models.Model): | |
if not hasattr(models.Manager, 'select_for_update'): | |
objects = ForUpdateManager() | |
# model definition | |
""" |
NewerOlder