Skip to content

Instantly share code, notes, and snippets.

View dhulihan's full-sized avatar

Dave Hulihan dhulihan

View GitHub Profile
@dhulihan
dhulihan / .vimrc
Created July 20, 2017 16:25
Print markdown header in vim
" Author: Dave Hulihan
" Purpose: Prints cute markdown header at the top
" of the file, based on filename.
" Print filename header in markdown
function! MarkdownHeader()
let @a = "#"
put! a
put %
normal ggJ
@mugifly
mugifly / img-conv-for-slack-emoji
Last active July 26, 2022 18:45
Image Converter for Slack Emoji (128px) - Required: ImageMagick.
#!/bin/bash
set -e
echo -e "Image Converter for Slack Emoji\nNOTICE: The image will be overwritten."
if [ $# -lt 1 ]; then
echo "USAGE:"
echo -e " ${0} IMG_FILE [IMG_FILE...]\n"
echo "IMG_FILE:"
@atrepca
atrepca / kafka.service
Created September 27, 2016 13:53
Kafka Systemd Service Configuration File for Ubuntu 16.04
[Unit]
Description=Apache Kafka server (broker)
Documentation=http://kafka.apache.org/documentation.html
Requires=network.target remote-fs.target
After=network.target remote-fs.target
[Service]
Type=simple
PIDFile=/var/run/kafka.pid
User=kafka
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 1, 2024 17:49
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@mottyc
mottyc / kafka-service-script
Last active January 10, 2022 07:07
Kafka service script (copy to file: /etc/init.d/kafka)
#! /bin/sh
# /etc/init.d/kafka: start the kafka daemon.
# chkconfig: - 80 20
# description: kafka
KAFKA_HOME=/usr/share/kafka
KAFKA_USER=root
KAFKA_SCRIPT=$KAFKA_HOME/bin/kafka-server-start.sh
KAFKA_CONFIG=$KAFKA_HOME/config/server.properties
@dbalan
dbalan / iTerm.md
Last active January 13, 2021 12:55
iterm cheetsheet

iTERM2 Cheetsheet

Fancy Utilities

  1. Paste history: ⌘ + Shift + h
  2. Instant Replay: ⌘ + Opt + b
  3. Mouseless selection: ⌘ + f; Tab
  4. Smart select: Quad-Click
  5. Rectangle Select: ⌘ + Opt + Select
  6. Open link (URL/File): ⌘ + Click
@elado
elado / cequel-database_cleaner.rb
Last active April 8, 2021 08:25
Cequel + DatabaseCleaner and RSpec
# in spec_helper.rb
RSpec.configure do |config|
records = []
config.before :suite do
Cequel::Record.descendants.each do |klass|
klass.after_create {|r| records << r }
end
end
@willurd
willurd / web-servers.md
Last active April 28, 2024 21:38
Big list of http static server one-liners

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.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
# Store somewhere
class SitemapGenerator
def initialize(app)
@app = app
end
def manipulate_resource_list(resources)
sitemap_builder = ::Middleman::Sitemap::Resource.new(
@app.sitemap,
@kiesia
kiesia / attributes-default.rb
Created July 5, 2012 06:12 — forked from philwo/attributes-default.rb
Chef cookbook for nginx + passenger (compiled from source)
default['nginx']['version'] = "1.2.0"
default['nginx']['passenger']['version'] = "3.0.12"