Skip to content

Instantly share code, notes, and snippets.

@markwk
markwk / writings-tracking-with-git.bash
Last active April 18, 2024 13:41
My Writings Tracker with Git: A bash script for tracking my writings in plain tex files, calculate stats like word count, hashtags and new files, store stats to csv and commit to git.
#!/bin/bash
##################################
#
# THE ARCHIVE TRACKER
#
# REF: https://gist.github.com/markwk/c85a8a72bc8c03d0f510262bb5219a34/
#
# INTRODUCTION:
# Daily script to navigate to a directory of plain text files,
# add files to git repo, calculate key stats, store stats to csv
@dathanb
dathanb / http_debug.rb
Last active February 15, 2024 12:23
Print Raw HTTP Request and Response Payload in Ruby
module Net
class HTTP
alias_method(:orig_request, :request) unless method_defined?(:orig_request)
def request(req, body = nil, &block)
puts '===== REQUEST ====='
puts "Request: #{req.method} http://#{@address}:#{@port}#{req.path}"
puts 'Request headers: '
req.each_header do |key, value|
puts "\t#{key}: #{value}"

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@dobrinov
dobrinov / HOWTO.md
Last active April 18, 2023 20:13
Webpack + Rails (wihthout Webpacker)

Webpack + Rails (wihthout Webpacker)

This document describes everything needed to integrate Webpack with a Rails project. The Webpack configuration here could be simplified even more if React & Typescript support is not needed.

lib/webpack/asset.rb

module Webpack
  module Asset
    extend self
@sjl
sjl / Menlo-ForPowerline.ttc.zip
Created January 17, 2012 18:09
Patched Menlo for Powerline. This one includes the bold, italic, etc variants.