Skip to content

Instantly share code, notes, and snippets.

@dkvdm
dkvdm / coffee.json
Created February 12, 2020 02:29
Espresso logging tool for ReTool.com
{"uuid":"c3670f20-49de-11ea-b086-1774f31b91ea","page":{"id":4898493,"data":{"appState":"[\"~#iR\",[\"^ \",\"n\",\"appTemplate\",\"v\",[\"^ \",\"isFetching\",false,\"plugins\",[\"~#iOM\",[\"ListLogItems\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"ListLogItems\",\"type\",\"datasource\",\"subtype\",\"SqlQuery\",\"resourceName\",\"managed_db (readonly)\",\"template\",[\"^3\",[\"queryRefreshTime\",\"\",\"databasePasswordOverride\",\"\",\"queryDisabledMessage\",\"\",\"successMessage\",\"\",\"queryDisabled\",\"\",\"playgroundQuerySaveId\",0,\"resourceNameOverride\",\"\",\"runWhenModelUpdates\",true,\"query\",\"select * from \\\"espresso_log\\\";\",\"playgroundQueryUuid\",\"\",\"playgroundQueryId\",0,\"privateParams\",[\"~#iL\",[]],\"triggersOnSuccess\",[\"^8\",[]],\"runWhenPageLoadsDelay\",\"\",\"warningCodes\",[\"^8\",[]],\"data\",null,\"importedQueryInputs\",[\"^3\",[]],\"showSuccessConfetti\",false,\"isImported\",false,\"showSuccessToaster\",true,\"dataArray\",[\"^8\",[]],\"cacheKeyTtl\",\"\
#!/bin/sh
### BEGIN INIT INFO
# Default-Start: 2 3 4 5
# Provides: nzbget
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start the nzbget processes
# Description: starts and stops nzbget
@dkvdm
dkvdm / pew.zsh
Created January 4, 2016 08:08
Automatically use pew to enter virtualenv based on path with zsh
# Automatically activate pew virtualenv
function pew_venv_hook() {
envs=("${(s/ /)$(pew ls)}")
new_env=""
_venv=$(basename "$VIRTUAL_ENV")
current_env=$_venv${_venv:+}
for env in $envs; do
if [[ "$PWD" =~ $env ]]
then
new_env=$env
@dkvdm
dkvdm / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<header id="banner" class="navbar navbar-inverse navbar-fixed-top" role="banner">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="<?php echo home_url(); ?>/">
<?php bloginfo('name'); ?>
<header id="banner" class="navbar navbar-inverse navbar-fixed-top" role="banner">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="<?php echo home_url(); ?>/">
<?php bloginfo('name'); ?>
</a>
<nav id="nav-main" class="nav-collapse" role="navigation">
<?php wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => 'nav')); ?>
</nav>
</div>
<?php
/**
* Redirects search results from /?s=query to /search/query/, converts %20 to +
*
* @link http://txfx.net/wordpress-plugins/nice-search/
*/
function roots_nice_search_redirect() {
if (is_search() && strpos($_SERVER['REQUEST_URI'], '/wp-admin/') === false && strpos($_SERVER['REQUEST_URI'], '/search/') === false) {
wp_redirect(home_url('/search/' . str_replace(array(' ', '%20'), array('+', '+'), urlencode(get_query_var('s')))), 301);
@dkvdm
dkvdm / gist:1491273
Created December 17, 2011 20:27
pyQt installation problems
==> Downloading http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-mac-gpl-4.8.6.tar.gz
File already downloaded in /Users/FLX/Library/Caches/Homebrew
/usr/bin/tar xf /Users/FLX/Library/Caches/Homebrew/pyqt-4.8.6.tar.gz
==> python ./configure.py --confirm-license --bindir=/usr/local/Cellar/pyqt/4.8.6/bin --destdir=/usr/local/Cellar/pyqt/4.8.6/lib/python --sipdir=/usr/local/Cellar/pyqt/4.8.6/share/sip
python ./configure.py --confirm-license --bindir=/usr/local/Cellar/pyqt/4.8.6/bin --destdir=/usr/local/Cellar/pyqt/4.8.6/lib/python --sipdir=/usr/local/Cellar/pyqt/4.8.6/share/sip
Determining the layout of your Qt installation...
This is the GPL version of PyQt 4.8.6 (licensed under the GNU General Public
License) for Python 2.7.2 on darwin.
Found the license file pyqt-gpl.sip.
Checking to see if the QtGui module should be built...