Skip to content

Instantly share code, notes, and snippets.

@bartkamphuis
bartkamphuis / argh_examples.py
Created September 20, 2023 00:00 — forked from safijari/argh_examples.py
Python Libraries Video 1
import argh
def do_the_thing(required_arg, optional_arg=1, other_optional_arg=False):
"""
I am a docstring
"""
print((required_arg, type(required_arg)))
print((optional_arg, type(optional_arg)))
print((other_optional_arg, type(other_optional_arg)))
#!/bin/sh
cd /path/to/your/repo/
gunzip -v < [database].sql.gz | mysql -u [mysql_user] -p[mysql_password] [database]
# Note:
# No need to have these comments in the file...
# This file's location @ /path/to/your/repo/.git/hooks/post-merge
# Be sure to make this file executable via:
# sudo chmod +x /path/to/your/repo/.git/hooks/post-merge
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
copy: {
build: {
cwd: 'source',
src: [ '**', '!**/*.styl', '!**/*.coffee', '!**/*.jade' ],
dest: 'build',
<?php
namespace Widop\Mink\Extension;
/**
* Dictionary to manage popups.
*
* @author Benjamin Lazarecki <[email protected]>
*/
trait PopupDictionary
@bartkamphuis
bartkamphuis / show_column_types.sql
Created May 14, 2013 05:46
SQL to show all column types for a particular database schema
SELECT DISTINCT table_name, column_name, column_type
FROM information_schema.columns
WHERE table_schema = 'testing'
ORDER BY `columns`.`COLUMN_TYPE` ASC
#!/bin/bash
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3"
# this script will display the current version, automatically
# suggest a "minor" version update, and ask for input to use
# the suggestion, or a newly entered value.
<?php
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;
use Ratchet\Server\IoServer;
use Ratchet\WebSocket\WsServer;
/**
* chat.php
* Send any incoming messages to all connected clients (except sender)
*/