Skip to content

Instantly share code, notes, and snippets.

@marshyyyy
marshyyyy / BlockYouTubeHostsFile
Created November 18, 2017 05:02
Block YouTube Hosts File
0.0.0.0 host.youtube.com
0.0.0.0 mx.youtube.com
0.0.0.0 admin.youtube.com
0.0.0.0 devel.youtube.com
0.0.0.0 stats.youtube.com
0.0.0.0 http.youtube.com
0.0.0.0 mx0.youtube.com
0.0.0.0 administration.youtube.com
0.0.0.0 development.youtube.com
0.0.0.0 svn.youtube.com
@ssaavedra
ssaavedra / org-clock-back.el
Last active October 1, 2018 11:59
Convert orgmode clocktable time to numbers
;; Receive time as a string like "9d 11:28"
;; Outputs the number of minutes in that
;; The regex works with and without days.
;; MIT License
(defun my-minutes-in-org-time (time)
(let ((re "\\(\\([0-9]+\\)d \\)?\\([0-9]+\\):\\([0-9]+\\)")
(values '(2 3 4)))
(save-match-data
(catch 'exit
(if (not (string-match re time))
@audreyfeldroy
audreyfeldroy / pypi-release-checklist.md
Last active February 23, 2023 15:03
My PyPI Release Checklist
  • Update HISTORY.md
  • Commit the changes:
git add HISTORY.md
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch
@insin
insin / bash_prompt.sh
Created December 3, 2011 01:49 — forked from woods/git_svn_bash_prompt.sh
Set color bash prompt according to active virtualenv, git branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@wrunk
wrunk / jinja2_file_less.py
Last active September 19, 2023 15:05
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
@artero
artero / launch_sublime_from_terminal.markdown
Last active January 25, 2024 16:57 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation