Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
// | |
// NSImage+TMStretchable.h | |
// ThinkMessenger | |
// | |
// Created by David Beck on 1/11/12. | |
// Copyright (c) 2012 ThinkUltimate. All rights reserved. | |
// | |
#import <AppKit/AppKit.h> |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/usr/bin/php | |
<?php | |
$files = shell_exec('git diff-index --name-only --cached --diff-filter=ACMR HEAD | grep "\.php$"'); | |
$files = explode("\n", trim($files)); | |
$exitCode = 0; | |
foreach ($files as $file) { | |
if (empty($file)) { |
This gist was getting a lot of comments/questions, but since there are no notifications when someone replies to a gist, I've moved the setup instructions and a bunch of sample code to a dedicated Github repo.
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.17254902422428131</real> |
<?php | |
function chain($object) | |
{ | |
return new class ($object) { | |
protected $lastReturn = null; | |
public function __construct($object) | |
{ | |
$this->wrapped = $object; |
<?php | |
// Register these inside a service provider: | |
Blade::directive('route', function ($expression) { | |
return "<?php echo route({$expression}) ?>"; | |
}); | |
Blade::directive('routeIs', function ($expression) { | |
return "<?php if (request()->routeIs({$expression})) : ?>"; |
// This is now built into `npx auth add apple`! :tada: | |
// https://github.com/nextauthjs/cli/pull/10 | |
#!/bin/node | |
import { SignJWT } from "jose" | |
import { createPrivateKey } from "crypto" | |
if (process.argv.includes("--help") || process.argv.includes("-h")) { |