This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.
— Erik
set myVolume to output volume of (get volume settings) | |
set myVolume to (myVolume - 2) | |
set volume output volume myVolume | |
tell application "PowerMate" | |
set aDevice to first device | |
tell aDevice | |
make light state with properties {state type:steady, brightness:(myVolume / 100), name:"Volume"} | |
end tell | |
end tell |
if(!(window.jQuery)) { | |
var script = document.createElement("script"); | |
script.setAttribute("src", "https://code.jquery.com/jquery-2.2.1.min.js"); | |
script.setAttribute("type", "text/javascript"); | |
script.onload = logItems; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
} else { | |
logItems(); | |
} |
#!/usr/bin/php | |
<?php | |
require __DIR__ . '/../../vendor/autoload.php'; | |
/** | |
* Dependencies: | |
* - Symfony Console Component: symfony/console | |
* - Symfony Process Component: symfony/process | |
* - PHP Mess Detector: phpmd/phpmd |
<?php $span = isset($span) ? $span : 8; ?> | |
<?php $page = isset($this->request->params['named']['page']) ? $this->request->params['named']['page'] : 1; ?> | |
<div class="pagination"> | |
<ul> | |
<?php echo $this->Paginator->prev( | |
'← ' . __('Previous'), | |
array( | |
'escape' => false, | |
'tag' => 'li' | |
), |
The problem: | |
I wanted to use the jinja 'map' filter to modify each item in a string, in this simple | |
example, adding '.conf' to each item. | |
The 'format' filter in jinja takes arguments (value, *args, **kwargs). Unfortunately, | |
it uses 'value' as the pattern. When called inside map 'value' is the current item in | |
the list, or in other words *args as far as format is concerned. So it's the wrong way | |
around. |
import sys | |
import subprocess | |
import tempfile | |
import urllib | |
text = sys.stdin.read() | |
chart_url_template = ('http://chart.apis.google.com/chart?' | |
'cht=qr&chs=300x300&chl={data}&chld=H|0') | |
chart_url = chart_url_template.format(data=urllib.quote(text)) |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Guild Wars 2: Item search</title> | |
</head> | |
<body> | |
<div id="loader">Loading…</div> | |
<div id="app" style="display: none;"> |
(* | |
File: | |
Application.applicationWillSwitchOut.scpt | |
Abstract: | |
This script will automatically save all on-disk text documents with unsaved | |
changes when BBEdit loses focus. | |
Version: |