Skip to content

Instantly share code, notes, and snippets.

View legoktm's full-sized avatar

Kunal Mehta legoktm

View GitHub Profile
@atdt
atdt / keyclean
Created July 1, 2015 20:43
Temporarily disable MBP's internal keyboard, so I can clean it :)
#!/usr/bin/env bash
KEYBOARD_KEXT="/System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/"
countdown() {
local seconds="$1"
while [ $seconds -gt 0 ]; do
sleep 1 &
echo -n "${seconds}.. "
seconds=$(( $seconds - 1 ))
@reedy
reedy / updatetohead
Created September 24, 2014 15:32
Script to update mediawiki submodule to the head of its deployment branch
#!/bin/bash
if [ $# -ne 2 ]
then
echo "Usage: `basename $0` <branch> <extension>"
echo "e.g. `basename $0` 1.21wmf6 CodeReview"
exit
fi
PWD="`pwd`"
@atdt
atdt / huggle3.rb
Created December 10, 2013 17:18
Huggle formula for Homebrew
require 'formula'
class Huggle3 < Formula
homepage 'https://en.wikipedia.org/wiki/Wikipedia:Huggle'
head 'https://github.com/huggle/huggle3-qt-lx.git'
sha1 '15072960560b963ab317b2088ff8951f8c5287ae'
depends_on 'qt'
def install
@thcipriani
thcipriani / baller_motd.md
Last active February 12, 2023 12:28
Using img2ponysay to create baller /etc/motd message

Update: I made this a proper blog post

Creating Baller/Useful MOTD Messages

Zangief MOTD

Prerequisites

  • linux box
@atdt
atdt / dump-schema.json
Created November 27, 2012 04:06
Convert dump to line-separated JSON, suitable for BigQuery
[
{
"name": "content",
"type": "string"
},
{
"name": "ns",
"type": "integer"
},
{
@atdt
atdt / wp-telnet.js
Created November 8, 2012 06:32
Wikipedia Telnet Server
// Wikipedia telnet server
//
// To install depenedncies:
// npm install request
// npm install cheerio
//
var net = require( 'net' );
var cheerio = require('cheerio');
var request = require('request');
@twisty
twisty / php-syntax-check.md
Last active April 4, 2021 16:55
Check for PHP syntax errors for multiple files in a set of folders using PHP's "lint" option.

Syntax check php files in folders:

find ./foo ./bar \( -name "*.php" -or -name "*.phtml" \) -print0 | xargs -0 -n 1 php -l
@vangberg
vangberg / DWM-ON-OS-X.md
Created February 22, 2010 19:24
dwm on os x [work in progress!]

Installing and configuring dwm on OS X

  1. Install XQuartz (http://xquartz.macosforge.org) which is the development version of the X11.app that ships with OS X, which means it is way more up to date. I have had some weird issues with X11.app v. 2.3-something. XQuartz 2.5.0 fixed that.

  2. Install dwm from Homebrew, brew install dwm. This makes a bunch of necessary tweaks to the DWM configuration.

  3. Add the following script to $PATH, name it dwm-launch and chmod 755:

    cd ~
    

while true