Skip to content

Instantly share code, notes, and snippets.

View kodybrown's full-sized avatar
💭
I may be slow to respond.

Kody Brown kodybrown

💭
I may be slow to respond.
View GitHub Profile
@jtriley
jtriley / terminalsize.py
Created July 26, 2011 21:58
Get current terminal size on Linux, Mac, and Windows
#!/usr/bin/env python
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()
@kristopherjohnson
kristopherjohnson / PrettyXml.cs
Created December 4, 2011 18:52
Example of pretty-printing XML in C# using the XmlWriter class
using System;
using System.Text;
using System.Xml;
using System.Xml.Linq;
static string PrettyXml(string xml)
{
var stringBuilder = new StringBuilder();
var element = XElement.Parse(xml);
@harthur
harthur / snippet.md
Created June 18, 2012 22:12
console.log() key binding for Sublime Text

Go to Sublime Text 2 > Preferences > Key Bindings - User and add this JSON to the file:

[
    { "keys": ["super+shift+l"],
      "command": "insert_snippet",
      "args": {
        "contents": "console.log(${1:}$SELECTION);${0}"
      }
 }
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 28, 2024 21:36
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mmdemirbas
mmdemirbas / beep.bat
Created September 23, 2012 10:58
Windows batch file to generate a beep sound after a certaion amount of time.
:: usage:
:: beep -- beeps immediately
:: beep 1 -- beeps after 1 sec
:: beep 1:2 -- beeps after 1 min, 2 sec
:: beep 1:2:3 -- beeps after 1 hour, 2 min, 3 sec
:: beep 1:2:3:4 -- beeps after 1 day, 2 hours, 3 min, 4 sec
::
:: invalid usages:
:: beep 1::2
:: beep :1
@simeonmiteff
simeonmiteff / tunetest.py
Created September 27, 2012 07:29
Simple rtl_tcp client to test rapid tuning
#! /usr/bin/env python2
# Small test client for rtl_tcp
# Simeon Miteff <simeon.miteff@gmail.com>
# Thu Sep 27 09:28:55 SAST 2012
import socket
import struct
import time
SET_FREQUENCY = 0x01
SET_SAMPLERATE = 0x02
@mmdemirbas
mmdemirbas / set-ntfs-ro.ps1
Created March 23, 2013 20:54
PowerShell script to set or clear NTFS read-only flag of a volume by volume label
#########################################################################
# #
# Script to set or clear read-only flag of an NTFS volume. #
# #
# Usage: .\set-ntfs-ro.ps1 set "MY DISK LABEL" #
# .\set-ntfs-ro.ps1 clear "MY DISK LABEL" #
# #
# Author: Muhammed Demirbas, mmdemirbas at gmail dot com #
# Date : 2013-03-23 #
# #

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@gabrielhpugliese
gabrielhpugliese / meteor-windows-vagrant-tutorial.md
Last active April 19, 2022 14:37
Tutorial for running Meteor in Windows using Vagrant

Tutorial: Meteor in Windows using Vagrant

BEFORE YOU CONTINUE:

  • Now, Meteor runs in any Windows without any line of this tutorial. Just download the Meteor binary! Yay!!
  • mrt is no longer used with Meteor 1.0

These days some people were discussing at meteor-talk group about running Meteor at Windows and I’ve recommended them using Vagrant. It’s a very developer-friendly piece of software that creates a virtual machine (VM) which let you run any operating system wanted and connect to it without big efforts of configuration (just make the initial installation and you have it working).

Many packages (I've tested) for running Meteor+Vagrant fails because Meteor writes its mongodb file and also other files inside local build folder into a shared folder between the Windows host and the Linux guest, and it simply does not work. So I've put my brain to work and found a solution: do symlinks inside the VM (but do not use ln. Use mount so git can follow it). It’s covered on

@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active July 2, 2024 00:02
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName