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
| // It is important to declare your variables. | |
| (function() { | |
| var foo = 'Hello, world!'; | |
| print(foo); //=> Hello, world! | |
| })(); | |
| // Because if you don't, the become global variables. | |
| (function() { |
| (defun decode-entities (dirty-string) | |
| "Interprets a string of space-separated numbers as an | |
| ASCII string" | |
| (mapconcat (lambda (x) (format "%c" (string-to-number x))) | |
| (split-string (clean-encoded-string dirty-string)) | |
| "")) | |
| (defun clean-encoded-string (string) | |
| "Removes useless characters and replaces linebreaks with a | |
| line-feed (LF) char." |
| #!/usr/bin/perl | |
| # Description: http://daringfireball.net/2010/08/open_urls_in_safari_tabs | |
| # License: See below. | |
| # http://gist.github.com/507356 | |
| use strict; | |
| use warnings; | |
| use URI::Escape; |
| // | |
| // Regular Expression for URL validation | |
| // | |
| // Author: Diego Perini | |
| // Created: 2010/12/05 | |
| // Updated: 2018/09/12 | |
| // License: MIT | |
| // | |
| // Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
| // |
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
Let’s say your GitHub username is “alice”. If you create a GitHub repository named alice.github.com, commit a file named index.html into the master branch, and push it to GitHub, then this file will be automatically published to http://alice.github.com/... The same works for organizations.
Read more here: http://pages.github.com/
However... the downside of this is that anyone that forks this repo won't get it as a GitHub Pages repo when they are working on it... because they have a different GitHub "username" (or "organisation name").
So the trick is to not use a master branch as the documentation tells you... rather, use a gh-pages branch, as you would for your other "Project Pages".
| #!/bin/sh | |
| PROG=$0 | |
| RSYNC="/usr/bin/rsync" | |
| SRC="/" | |
| DST="/Volumes/Backup/" | |
| # rsync options | |
| # -v increase verbosity | |
| # -a turns on archive mode (recursive copy + retain attributes) |
| #!/usr/bin/env ruby | |
| require 'spreadsheet' | |
| # Begin Test | |
| print "Spreadsheet Test\n" | |
| # Create the rows to be inserted | |
| row_1 = ['A1', 'B1'] | |
| row_2 = ['A2', 'B2'] |
These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).
First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter (2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.
Finally all remaining files are listed using git ls, the files to keep are removed from that using grep -v and the resulting list is passed to git rm which is invoked by git filter-branch --index-filter (3.). A bit convoluted but it does the trick.
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>BuildMachineOSBuild</key> | |
| <string>11B26</string> | |
| <key>CFBundleDevelopmentRegion</key> | |
| <string>English</string> | |
| <key>CFBundleExecutable</key> | |
| <string>CoffeeScript</string> |