Skip to content

Instantly share code, notes, and snippets.

View Amourspirit's full-sized avatar

:Barry-Thomas-Paul: Moss Amourspirit

  • Huntsville, Ontario, Canada
View GitHub Profile
@ramnathv
ramnathv / gh-pages.md
Created March 28, 2012 15:37
Creating a clean gh-pages branch

Creating a clean gh-pages branch

This is the sequence of steps to follow to create a root gh-pages branch. It is based on a question at [SO]

cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.html
@cosimo
cosimo / parse-options.sh
Created September 21, 2012 09:31
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
@magopian
magopian / pre-commit
Created November 16, 2012 10:40
git pre-commit hook for sphinx documentation
#!/bin/sh
#
# This pre-commit hook tests that the documentation builds correctly.
# It can be disabled by using the "-n" option with "git commit".
#
# See http://git-scm.com/book/en/Customizing-Git-Git-Hooks for details.
#
# This pre-commit hook requires that you have the "###PROJECT###" project on your python
# path, in order for the DJANGO_SETTINGS_MODULE=###PROJECT###.settings to work.
# This is needed to build the apidoc.
@dongilbert
dongilbert / lead_controller.php
Created December 3, 2012 15:00
Joomla Export to CSV
<?php
/**
* @version 1.0.0
* @package com_stats
* @copyright Copyright (C) 2012. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access.
defined('_JEXEC') or die;
@digitaljhelms
digitaljhelms / gist:4287848
Last active November 16, 2024 01:10
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@kyouko-taiga
kyouko-taiga / wrapper.py
Last active August 9, 2023 06:05
A python class wrapper to instrument/override properties
# This snippet was written by Dimitri Racordon ([email protected])
#
# Copyright (c) 2015 Dimitri Racordon
# Licensed under the The MIT License (MIT).
class lazy(object):
# This class is heavily inspired by the werkzeug.utils.cached_property
# decorator. It transforms a class method to a lazy property, evaluated
# the first time the property is accessed.
@izderadicka
izderadicka / megaback.sh
Last active February 7, 2022 04:53
backup script for megatools
#!/bin/bash
BACKUP_DIR="/Root/Backup/"
PIECE_SIZE=10M
ACTION=store
trap "exit 2" SIGINT
if [[ $1 =~ -h|--help ]]; then
@tasdikrahman
tasdikrahman / python_tests_dir_structure.md
Last active October 31, 2024 10:03
Typical Directory structure for python tests

A Typical directory structure for running tests using unittest

Ref : stackoverflow

The best solution in my opinion is to use the unittest [command line interface][1] which will add the directory to the sys.path so you don't have to (done in the TestLoader class).

For example for a directory structure like this:

new_project

├── antigravity.py

@Amourspirit
Amourspirit / README.md
Last active January 29, 2016 17:00 — forked from jonahvsweb/README.md
Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result

@DavidWells
DavidWells / aligning-images.md
Last active November 14, 2024 03:45
Guide to aligning images in github readme.md files. https://davidwells.io/snippets/how-to-align-images-in-markdown

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment