A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
/* | |
* Copyright (c) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '2', |
A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.
python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
# From https://technet.microsoft.com/en-us/library/ff730944.aspx | |
# This will open an internet explorer window that will display all installed windows font names in their corresponding font. | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | |
$objFonts = New-Object System.Drawing.Text.InstalledFontCollection | |
$colFonts = $objFonts.Families | |
$objIE = New-Object -com "InternetExplorer.Application" | |
$objIE.Navigate("about:blank") | |
$objIE.ToolBar = 0 |
var elements = Array.from(document.querySelectorAll('.js-link-block')) | |
elements.map(function (element) { | |
var nameElement = element.querySelector('.chartlist-name') | |
return nameElement && nameElement.textContent.replace(/\s+/g, ' ').trim() | |
}).forEach(function (name, i, names) { | |
if (name !== names[i + 1]) return | |
var deleteButton = elements[i].querySelector('[data-ajax-form-sets-state="deleted"]') | |
if (deleteButton) deleteButton.click() | |
location.reload() | |
}) |
<?php | |
use Symfony\Component\Console\Helper\ProgressBar; | |
use Symfony\Component\Console\Output\ConsoleOutput; | |
class DoSomething extends Migration | |
{ | |
public function up() | |
{ | |
$output = new ConsoleOutput(); |
import cherrypy | |
html_header = \ | |
""" | |
<html> | |
<head> | |
<title>Example of GET and POST</title> | |
</head> | |
<body> | |
""" |