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
--- ../orig/nginx-1.0.11/src/http/modules/ngx_http_memcached_module.c 2010-05-20 15:46:01.000000000 +0400 | |
+++ src/http/modules/ngx_http_memcached_module.c 2012-01-13 17:58:18.000000000 +0400 | |
@@ -312,22 +312,15 @@ | |
if (ngx_strncmp(p, "VALUE ", sizeof("VALUE ") - 1) == 0) { | |
p += sizeof("VALUE ") - 1; | |
- | |
- if (ngx_strncmp(p, ctx->key.data, ctx->key.len) != 0) { | |
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | |
- "memcached sent invalid key in response \"%V\" " |
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
class ParallelWorker(threading.Thread): | |
def __init__(self, cb, fn, args, kwargs): | |
self._cb = cb | |
self._fn = fn | |
self._args = args | |
self._kwargs = kwargs | |
super(ParallelWorker, self).__init__() | |
def run(self): |
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
#!/usr/bin/env ruby | |
file = STDIN.read[/lessc: ([^*]+\.less)/, 1] || ENV["TM_FILEPATH"] | |
outname = File.dirname(file) + "/" + File.basename(file, File.extname(file)) + ".css" | |
output = IO.popen("lessc \"#{file}\" 2>&1", "w+") do |pipe| | |
pipe.close_write | |
pipe.read | |
end |
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 -*- | |
import re | |
import socket | |
class UnsupportedQuery(BaseException): | |
pass |
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
module HashMethods | |
def instance_hash_method(method_name) | |
required_args = [] | |
optional_args = [] | |
original_method = instance_method(method_name) | |
original_method.parameters.each do |type, name| | |
if type == :req | |
required_args.push name | |
elsif type == :opt |
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
Started GET "/phrases/show/1" for 202.152.201.168 at 2012-06-11 18:32:16 +0400 | |
Processing by PhrasesController#show as HTML | |
Parameters: {"id"=>"1"} | |
Completed 500 Internal Server Error in 1ms | |
ActiveRecord::StatementInvalid (PG::Error: ERROR: prepared statement "a4" already exists | |
: SELECT "phrases".* FROM "phrases" WHERE "phrases"."id" = $1 LIMIT 1): | |
app/controllers/phrases_controller.rb:26:in `show' |
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
CGContextRef ctx = UIGraphicsGetCurrentContext(); | |
CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB(); | |
NSArray *gradientColors = @[(id)_startColor.CGColor, (id)_stopColor.CGColor]; | |
NSArray *highlightedColors = @[(id)_stopColor.CGColor, (id)_startColor.CGColor]; | |
CGGradientRef gradient = CGGradientCreateWithColors(colorspace, (__bridge CFArrayRef)gradientColors, NULL); | |
CGGradientRef highlightedGradient = CGGradientCreateWithColors(colorspace, (__bridge CFArrayRef)highlightedColors, NULL); | |
CGRect backgroundRect = rect; | |
UIBezierPath *backgroundPath = [UIBezierPath bezierPathWithRoundedRect:backgroundRect cornerRadius:3]; | |
CGContextSaveGState(ctx); |
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
#import <UIKit/UIKit.h> | |
@interface UILabel (TextTouch) | |
- (NSInteger)stringIndexUnder:(CGPoint)point; | |
@end |
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 -*- | |
import os | |
import sys | |
import json | |
from argparse import ArgumentParser | |
parser = ArgumentParser() | |
parser.add_argument("--haml", dest="haml", action="store_true", default=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
function getEmptyIndexes(arr) { | |
var px; | |
var py; | |
var i; | |
var rows = []; | |
var columns = []; | |
for (i = 0; i < arr.length; i++) { | |
columns[i] = 0; | |
} |