Skip to content

Instantly share code, notes, and snippets.

@waynemoore
waynemoore / month_day_range.py
Created July 27, 2011 11:01
Get first and last day of a particular month using python-dateutil.
import datetime
# requires python-dateutil (http://labix.org/python-dateutil)
from dateutil.relativedelta import relativedelta
def get_month_day_range(date):
"""
For a date 'date' returns the start and end date for the month of 'date'.
Month with 31 days:
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 20, 2024 15:48
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@TylerFisher
TylerFisher / hosting-on-github.md
Last active July 16, 2024 09:24
Basic steps for hosting on Github

Hey there, apparently people are still using this Gist from 2013! It's out of date! Consult the Github docs.

Steps for Hosting a Website on GitHub

  1. Create a GitHub account on github.com.
  2. Download either [GitHub for Mac][1] or [GitHub for Windows][2], depending on your operating system. Open the app and log in using the account you just created.
  3. (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
  4. Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
  5. Move your website's files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level
@RIAEvangelist
RIAEvangelist / Install Cloud9 on local or remote computer, server, or raspberry pi
Last active June 6, 2023 03:37
This gist will help you install Cloud9 on your local or remote computer, server, or even your raspberry pi. Many people are having issues at the time of this Gist's creation.
Complete installation process:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y python-software-properties python make build-essential g++ curl libssl-dev apache2-utils git libxml2-dev
sudo apt-get update
sudo apt-get upgrade
cd ~
mkdir git
cd ~/git
@M1ke
M1ke / README.md
Last active December 7, 2022 22:05
Quickly convert a markdown file into a nice looking PDF formatted in the same way GitHub formats Readme.md files

Markdown to PDF

Quickly convert a markdown file into a nice looking PDF formatted in the same way GitHub formats Readme.md files

  • Install grip $ pip install grip
  • Install wkhtmltopdf $ sudo apt-get install wkhtmltopdf
@ericelliott
ericelliott / essential-javascript-links.md
Last active July 18, 2024 15:03
Essential JavaScript Links
@paulirish
paulirish / readme.md
Last active April 2, 2024 20:18
resolving the proper location and line number through a console.log wrapper

console.log wrap resolving for your wrapped console logs

I've heard this before:

What I really get frustrated by is that I cannot wrap console.* and preserve line numbers

We enabled this in Chrome DevTools via blackboxing a bit ago.

If you blackbox the script file the contains the console log wrapper, the script location shown in the console will be corrected to the original source file and line number. Click, and the full source is looking longingly into your eyes.

@giovtorres
giovtorres / virt-install-centos
Last active March 15, 2023 09:57
Install CentOS cloud images on KVM using cloud-init
#!/bin/bash
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.**
## **This updated version has more options and less hardcoded variables.**
# Take one argument from the commandline: VM name
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
# Download curses wheel package
http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses
# Install curses via pip
pip install python -m pip install Downloads/curses-2.2-cp27-none-win_amd64.whl
# Run bpython-curses instead of bpython
bpython-curses
@rdnlsmith
rdnlsmith / gnome-terminal-powershell-profile.md
Last active November 10, 2023 14:35
Launch PowerShell Core in a GNOME Terminal window with a PowerShell color theme