As configured in my dotfiles.
start new:
tmux
start new with session name:
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Chromecast init</title> | |
| <script src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script> | |
| </head> | |
| <body> | |
| <div id="message"></div> | |
| <script type="text/javascript"> |
| /* | |
| * Copyright (c) 2014 Gerwin Sturm, FoldedSoft e.U. / www.foldedsoft.at | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); you may | |
| * not use this file except in compliance with the License. You may obtain | |
| * a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| from urllib import urlencode | |
| def destructive_encode(instring): | |
| if isinstance(instring, unicode): | |
| print('is unicode') | |
| outstring = instring.encode('utf8') | |
| elif isinstance(instring, str): |
| #!/bin/bash | |
| echo "Generating an SSL private key to sign your certificate..." | |
| openssl genrsa -des3 -out myssl.key 1024 | |
| echo "Generating a Certificate Signing Request..." | |
| openssl req -new -key myssl.key -out myssl.csr | |
| echo "Removing passphrase from key (for nginx)..." | |
| cp myssl.key myssl.key.org | |
| openssl rsa -in myssl.key.org -out myssl.key |
As configured in my dotfiles.
start new:
tmux
start new with session name:
JSON
| private void loadRules(Map<String, Object> rules, ResultSet results) throws SQLException { | |
| // create map to hold results | |
| while(results.next()) { | |
| DataType dataType | |
| = new ReferenceTableEntryFactory<DataType>().createFromCode(results.getInt(4), DataType.values()); | |
| switch (dataType) { | |
| case Boolean: | |
| rules.put(results.getString(3), results.getBoolean(6)); | |
| break; | |
| case TinyInt: |
| from django import db | |
| def show_queries(): | |
| for query in db.connection.queries: | |
| print query["sql"] | |
| db.reset_queries() |
| import unittest | |
| l = [["foo", "a", "a",], ["bar", "a", "b"], ["lee", "b", "b"]] | |
| class TestSequense(unittest.TestCase): | |
| pass | |
| def test_generator(a, b): | |
| def test(self): | |
| self.assertEqual(a,b) |
| class SerializableMixin(object): | |
| """ | |
| Mixin to convert an Object to json-encodable standard types | |
| We only want to encode public properties | |
| """ | |
| def deserialize(self, values): | |
| for k, v in values.items(): | |
| if hasattr(self, k): | |
| setattr(self, k, v) |