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
<script type="text/javascript"> | |
$(function(){ | |
var timeout = 10000; | |
analytics.ready(function() { | |
analytics._timeout = timeout; | |
}) | |
analytics.trackForm($('.email-submit'), "Email Signup", { | |
"landing_page": "first" | |
}); |
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
hduser@dpn-linux-desktop:/usr/local/hadoop$ start-dfs.sh | |
14/10/24 09:43:28 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable | |
Starting namenodes on [localhost] | |
localhost: Error: JAVA_HOME is not set and could not be found. | |
localhost: Error: JAVA_HOME is not set and could not be found. | |
Starting secondary namenodes [0.0.0.0] | |
0.0.0.0: Error: JAVA_HOME is not set and could not be found. | |
14/10/24 09:43:38 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable | |
hduser@dpn-linux-desktop:/usr/local/hadoop$ |
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
hduser@dpn-linux-desktop:/usr/local/hadoop/spark-1.1.0-bin-hadoop2.4$ ./sbin/start-thriftserver.sh | |
14/10/22 14:27:27 INFO Configuration.deprecation: mapred.input.dir.recursive is deprecated. Instead, use mapreduce.input.fileinputformat.input.dir.recursive | |
14/10/22 14:27:27 INFO Configuration.deprecation: mapred.max.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize | |
14/10/22 14:27:27 INFO Configuration.deprecation: mapred.min.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize | |
14/10/22 14:27:27 INFO Configuration.deprecation: mapred.min.split.size.per.rack is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.rack | |
14/10/22 14:27:27 INFO Configuration.deprecation: mapred.min.split.size.per.node is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.node | |
14/10/22 14:27:27 INFO Configuration.deprecation: mapred.reduce.tasks is deprecated. Instead, use mapreduce.job.reduces | |
14/10/22 14:27:27 INFO Conf |
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
class TestCase(unittest.TestCase): | |
def __call__(self, *args, **kwargs): | |
alembic_cfg = Config("../alembic.ini") | |
alembic_cfg.set_section_option( | |
"alembic", "script_location", "../alembic") | |
command.upgrade(alembic_cfg, "head") | |
r = super(TestCase, self).__call__(*args, **kwargs) | |
command.downgrade(alembic_cfg, "base") | |
return r |
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 sqlalchemy import create_engine, Table | |
from sqlalchemy.schema import MetaData | |
from somewhere import settings | |
from collections import defaultdict | |
_engines = {} | |
_metadata = defaultdict(lambda: MetaData()) | |
_tables = defaultdict(dict) | |
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 twisted.internet import reactor | |
from twisted.internet.protocol import Factory, Protocol | |
from twisted.internet.endpoints import TCP4ClientEndpoint | |
class MetricCollector(Protocol): | |
def send_metric(self, name, value, timestamp): | |
self.transport.write("%s %d %d\n" % (name, value, timestamp)) | |
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
def page_gen(): | |
from mezzanine.pages.models import Page | |
pages = Page.objects.all() | |
for page in pages: | |
yield (page.title, "page") | |
ADMIN_MENU_ORDER = ( | |
# ("Content", ("pages.Page", "blog.BlogPost", | |
# "generic.ThreadedComment", ("Media Library", "fb_browse"),)), | |
# ("Site", ("sites.Site", "redirects.Redirect", "conf.Setting")), |
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
dpn@dpn-linux-desktop:~$ sudo apt-add-repository ppa:versable/elementary-update | |
You are about to add the following PPA to your system: | |
A supplementary PPA for elementaryOS Luna, providing elementaryOS based apps, third party icons for the elementary icon theme, additional plank themes and more. | |
For more elementaryOS visit http://www.elementaryupdate.com/ | |
For bug reports visit https://bugs.launchpad.net/elementary-community | |
More info: https://launchpad.net/~versable/+archive/elementary-update | |
Press [ENTER] to continue or ctrl-c to cancel adding it | |
Usage: lsb_release [options] |
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
def mygen(): | |
page = 1 | |
results = json.loads(requests.get("http://foo.com?p=%s" % page).content) | |
while results: | |
for r in results: | |
yield r | |
page += 1 | |
results = json.loads(requests.get("http://foo.com?p=%s" % page).content) | |
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
def dbus_handler(which): | |
def inner(f): | |
@wraps(f) | |
def decorator(*args, **kwargs): | |
return f(*args, **kwargs) | |
decorator.dbus_callback = which | |
return decorator | |
return inner |