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
- (NSString *)flattenHTML:(NSString *)html | |
trimWhiteSpace:(BOOL)trim { | |
NSScanner *theScanner = [NSScanner scannerWithString:html]; | |
NSString *text = nil; | |
while (! [theScanner isAtEnd]) { | |
// Start of the tag | |
[theScanner scanUpToString:@"<" | |
intoString:NULL]; |
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
<?php | |
$text = 'Labas, aš "esu" Linas.'; | |
$ws = '\s/\#~:+=&%@\-\x28\x29\]\[{}><"\''; // whitespace | |
$punc = ';,\.?!'; // punctuation | |
$text = preg_replace("#(?<=^|[$ws])\"(?=[^$ws$punc])#", '„', $text); | |
$text = preg_replace("#\"#", '“', $text); |
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
diff -ruN gearmand-1.1.9.orig/libgearman-1.0/gearman.h gearmand-1.1.9/libgearman-1.0/gearman.h | |
--- gearmand-1.1.9.orig/libgearman-1.0/gearman.h 2013-07-14 11:20:42.000000000 +0300 | |
+++ gearmand-1.1.9/libgearman-1.0/gearman.h 2013-10-16 11:55:31.000000000 +0300 | |
@@ -50,7 +50,7 @@ | |
#endif | |
#ifdef __cplusplus | |
-# include <tr1/cinttypes> | |
+# include <cinttypes> | |
# include <cstddef> |
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 yaml | |
from yaml.constructor import ConstructorError | |
try: | |
from yaml import CLoader as Loader | |
except ImportError: | |
from yaml import Loader | |
def no_duplicates_constructor(loader, node, deep=False): |
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
""" | |
Showcases a rather basic way to have multiple test data sets for a single unit test set. | |
Usage: | |
# add 3 and 7 together, see if 10 comes out | |
python test_addition.py | |
# or | |
TEST_DATA_CLASS=DevelopmentTestData python test_addition.py |
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
package CommonImports; | |
use strict; | |
use warnings; | |
use feature qw/ :5.18 /; | |
use Modern::Perl "2014"; | |
# Initializing at root level | |
use Log::Log4perl qw(:easy); |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use v5.18; | |
use Paws; | |
use Date::Parse; | |
use Data::Dumper; |
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
#!/bin/bash | |
ulimit -n 65536 | |
curl "http://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc" | \ | |
sudo apt-key add - | |
echo "deb http://packages.erlang-solutions.com/ubuntu precise contrib" | \ | |
sudo tee -a /etc/apt/sources.list.d/erlang-solutions.list | |
curl -s "https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.deb.sh" | \ |
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
ERROR: deadlock detected | |
DETAIL: Process 2440 waits for ShareLock on transaction 521934; blocked by process 2438. | |
Process 2438 waits for ShareLock on transaction 521935; blocked by process 2440. | |
Process 2440: WITH new_sentences (disable_triggers, language, media_id, publish_date, sentence, sentence_number, stories_id) AS (VALUES | |
-- New sentences to potentially insert | |
(FALSE, 'en', 5, '2014-04-30 12:34:20'::timestamp, 'Springbrook twins Andrew, Aaron Robinson headed for prep year at Putnam Science Academy', 0, 960), | |
(FALSE, 'en', 5, '2014-04-30 12:34:20'::timestamp, 'If you spent time in gyms around Montgomery County during the past few high school basketball seasons, you | |
probably heard their names.', 1, 960), | |
(FALSE, 'en', 5, '2014-04-30 12:34:20'::timestamp, 'Everyone in Montgomery County knows “the Robinson twins,” who starred for Springbrook over the past few sea |
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
WITH new_sentences (disable_triggers, language, media_id, publish_date, sentence, sentence_number, stories_id) AS (VALUES | |
-- New sentences to potentially insert | |
(FALSE, 'ro', 40536, '2013-04-17 17:38:37'::timestamp, 'Primaria nu vrea ca iesenii sa scape de taxa de timbru', 0, 110124077), | |
(FALSE, 'ro', 40536, '2013-04-17 17:38:37'::timestamp, 'Un consilier PP-DD a venit cu o solutie la drumurile pe care iesenii le fac pentru a plati taxele.', 1, 110124077), | |
(FALSE, 'ro', 40536, '2013-04-17 17:38:37'::timestamp, 'Avocatul Anca Preda a initiat un proiect de hotarare prin care oamenii pot achita taxa de timbru prin posta.', 2, 110124077), | |
(FALSE, 'ro', 40536, '2013-04-17 17:38:37'::timestamp, 'Tot ceea ce au de facut reprezentantii primariei este sa incheie un contract cu posta, fara sa plateasca vreun comision.”Nu ar fi niciun efort din partea primariei.', 3, 110124077), | |
(FALSE, 'ro', 40536, '2013-04-17 17:38:37'::timestamp, 'Nu se cere niciun commision.', 4, 110124077), | |
(FALSE, |
OlderNewer