Skip to content

Instantly share code, notes, and snippets.

View ticean's full-sized avatar

Ticean Bennett ticean

View GitHub Profile
@ticean
ticean / drop-mysql-tables.sh
Created May 10, 2011 23:34
Shell script to drop all tables from MySQL.
#!/bin/bash
# A shell script to delete / drop all tables from MySQL database.
# Usage: ./script user password dbnane
# Usage: ./script user password dbnane server-ip
# Usage: ./script user password dbnane mysql.nixcraft.in
# -------------------------------------------------------------------------
# Copyright (c) 2008 nixCraft project <http://www.cyberciti.biz/fb/>
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
@ticean
ticean / SVN_Git_Mirror.md
Created January 3, 2012 21:14
SVN Git Mirror

Create Git Mirror from SVN Repository

This guide will demonstrate how to mirror an SVN into a Git repo. You're the target audience if you're an SVN user, just getting started with Git and need to coax your project team over to Git.

The branching scenario has been simplified for clarity.

References

@ticean
ticean / Category.sql
Created December 10, 2010 04:45
A series of queries for selecting Magento entity EAV attributes, and their values. Lots of union here...
SET @entityid = '3';
SELECT ea.attribute_id, ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type'
FROM catalog_category_entity e
JOIN catalog_category_entity_varchar eav
ON e.entity_id = eav.entity_id
JOIN eav_attribute ea
ON eav.attribute_id = ea.attribute_id
WHERE e.entity_id = @entityid
UNION
@ticean
ticean / reaction-v3.0.4.custom.mk
Created March 11, 2020 15:21
A custom configuration for Reaction Development Platform.
###############################################################################
### Reaction OSS v3.0.4
### This is an example configuration and is not modified from the original
### reaction-v3.0.4.mk
###############################################################################
# List of tools that must be installed.
# A simple check to determine the tool is available. No version check, etc.
define REQUIRED_SOFTWARE
docker \
@ticean
ticean / jon-roam-daily-template.md
Created February 28, 2020 05:57 — forked from jborichevskiy/jon-roam-daily-template.md
The daily template I use for Roam Research https://roamresearch.com/
  • Weekly Agenda (created on a different day, and embedded with /Block Reference)
  • [[Morning Questions]] [[2/24 -- 3/1/2020]]
    • {{[[slider]]}} How many hours of sleep did I get?
    • [[What's one thing top of mind today?]]
    • [[What's the one thing I need to get done today to make progress?]]
  • Agenda
    • {{[[TODO]]}} 2 hours focused time
    • {{[[TODO]]}} Read 30 minutes #goal-learning #habit
  • Health & self-care
  • {{[[TODO]]}} 30 minutes outside #goal-health #habit
@ticean
ticean / map-fields-comparator.clj
Last active January 10, 2020 05:00
Clojure comparator for sorting maps on n fields with sort order.
(defmacro map-fields-comparator
"Comparator for sorting maps by field. `kw-orders` must be pairs of keywords
on which to sort and a sort direction, either :asc or :desc.
Example:
(map-fields-comparator :id :asc :time :desc)
The above is fine for key values that are inexpensive to compute from the values
being sorted. If the key values are expensive to compute, it is better to
@ticean
ticean / convertMkv
Created December 10, 2010 04:22
sabnzbd/sickbeard post-process script that runs both sabToSickBeard and mkv conversion for XBox360, using handbrake.
#!/bin/bash
############################################################
# Recursively peruses a directory and converts MKV files
# to MP4 for streaming to Xbox360.
#
# @author: Ticean Bennett
# @url: http://ticean.com
# @see: http://trac.handbrake.fr/wiki/CLIGuide#options
#
# @param file The complete file path.
@ticean
ticean / inventory-data-flow.txt
Last active June 27, 2019 22:49 — forked from impactmass/inventory-data-flow.txt
sequence diagram for reaction inventory data flow
title Inventory Data Flow
participant Kafka Topic
participant Shippable-Inventory-Plugin
participant Simple-Inventory-Plugin
participant Inventory
participant MongoDB SimpleInventory
participant MongoDB Products
participant MongoDB Orders
@ticean
ticean / kafka-cheat-sheet.md
Created April 29, 2019 19:41 — forked from ursuad/kafka-cheat-sheet.md
Quick command reference for Apache Kafka

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Describe a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

@ticean
ticean / tinyrepl.clj
Last active July 14, 2018 22:39
Lil' Nestable Clojure REPL
(def ^:dynamic repl-context)
(defn tinyrepl
"Simple REPL. :quit to exit."
[{:keys [prefix layer] :or {prefix "" layer 1} :as context}]
(let [pre (str prefix ">>>")]
(with-bindings {#'repl-context (assoc context
:prefix pre
:layer (inc layer))}
(print (str (ns-name *ns*) (str pre " ")))
(flush)