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 | |
/** | |
* @author Kristaps Karlsons <[email protected]> | |
* Licensed under MPL 1.1 | |
*/ | |
function mc_status($host,$port='25565') { | |
$timeInit = microtime(); | |
// TODO: implement a way to store data (memcached or MySQL?) - please don't overload target server | |
$fp = fsockopen($host,$port,$errno,$errstr,$timeout=10); |
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 | |
/** | |
* Unshorten links | |
* | |
* @param string $text | |
* @return string | |
*/ | |
function unshorten_links($text) { | |
$pattern = '#\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))#'; | |
$callback = create_function('$matches', ' |
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 | |
# /etc/init.d/worker-manager | |
# version 0.1 2012-12-17 (YYYY-MM-DD) | |
### BEGIN INIT INFO | |
# Provides: worker-manager | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
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
[{"0":["Laimnesis","Solvija","Solvita"],"1":["Indulis","Iva","Ivis","Ivo"],"2":["Miervalda","Miervaldis","Ringolds"],"3":["Ilva","Ilvita","Spodra"],"4":["S\u012bmanis","Zintis"],"5":["Arnita","Spulga"],"6":["Digm\u0101rs","Juli\u0101ns","Rota","Zigm\u0101rs"],"7":["Gatis","Ivanda"],"8":["Aksels","Alta","Kaspars"],"9":["Dorisa","Tatjana"],"10":["Franciska","Smaida"],"11":["Reina","Reinholds","Reinis","Ren\u0101ts"],"12":["Aira","\u0100rijs","\u0100ris","Harijs"],"13":["Raitis","Raits","Roberta","Roberts"],"14":["Felicita","F\u0113likss"],"15":["Lida","Lidija"],"16":["Dravis","Tenis"],"17":["Antis","Antonijs","Antons"],"18":["Alnis","Andulis"],"19":["Al\u0123is","A\u013c\u0123irds","O\u013c\u0123erts","Orests"],"20":["Agne","Agnese","Agnija"],"21":["Austris"],"22":["Grieta","Strauta","Rebeka"],"23":["Eglons","Kri\u0161s","Ksenija"],"24":["Sigurds","Sigvards","Zigurds"],"25":["Agneta","Agnis","Ansis"],"26":["Ildze","Ilze","Izolde"],"27":["K\u0101rlis","Spodris"],"28":["Aivars","Val\u0113rijs"],"29":["P\u0101rsla |
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
Traceback (most recent call last): | |
File "/home/skakri/projects/test/virtualenv/lib/python2.7/site-packages/flask/app.py", line 1701, in __call__ | |
return self.wsgi_app(environ, start_response) | |
File "/home/skakri/projects/test/virtualenv/lib/python2.7/site-packages/newrelic-1.10.2.38/newrelic/api/web_transaction.py", line 780, in __call__ | |
result = application(environ, _start_response) | |
File "/home/skakri/projects/test/virtualenv/lib/python2.7/site-packages/newrelic-1.10.2.38/newrelic/api/object_wrapper.py", line 220, in __call__ | |
self._nr_instance, args, kwargs) | |
File "/home/skakri/projects/test/virtualenv/lib/python2.7/site-packages/newrelic-1.10.2.38/newrelic/api/function_trace.py", line 93, in literal_wrapper | |
return wrapped(*args, **kwargs) | |
File "/home/skakri/projects/test/virtualenv/lib/python2.7/site-packages/flask/app.py", line 1689, in wsgi_app |
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 Image | |
import ImageChops | |
from twython import Twython | |
with open('current.txt', 'r+') as f: | |
index = int(f.read().strip()) | |
new_index = index + 1 | |
f.seek(0) | |
f.truncate(0) | |
f.write(str(new_index)) |
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
from django.conf.urls.defaults import * | |
from tastypie.paginator import Paginator | |
from tastypie.exceptions import BadRequest | |
from tastypie.resources import ModelResource | |
from tastypie.utils import trailing_slash | |
from haystack.query import SearchQuerySet, EmptySearchQuerySet | |
from clips.models import Clip |
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
/** | |
* Based off of the Lucene prolog parser in the wordnet contrib package within the | |
* main Lucene project. It has been modified to remove the Lucene bits and generate | |
* a synonyms.txt file suitable for consumption by Solr. The idea was mentioned in | |
* a sidebar of the book Solr 1.4 Enterprise Search Server by Eric Pugh. | |
* | |
* @see <a href="http://lucene.apache.org/java/2_3_2/lucene-sandbox/index.html#WordNet/Synonyms">Lucene Sandbox WordNet page</a> | |
* @see <a href="http://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/contrib/wordnet/">SVN Repository of the WordNet contrib</a> | |
* @see <a href="https://www.packtpub.com/solr-1-4-enterprise-search-server/book">Solr 1.4 Enterprise Search Server Book</a> | |
*/ |
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
# | |
# Django | |
# | |
# better solution than model_to_dict, if you need model instance dict, which holds m2m field values | |
# source: https://djangosnippets.org/snippets/2278/ (gabipurcaru) | |
from types import NoneType | |
from django.db.models.manager import Manager | |
from django.db.models import Model |
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
19.lv | |
2m.lv | |
3000.lv | |
32maijs.lv | |
4dance.lv | |
4metri.lv | |
57paralele.lv | |
5ezeri.lv | |
5g.lv | |
a4d.lv |
OlderNewer