Skip to content

Instantly share code, notes, and snippets.

@begeeben
begeeben / jenkinsfile
Created March 5, 2019 02:06
Jenkins pipeline examples
// send build commit status to Github a pull request
def getCommitSha() {
dir('webfront_general') {
sh "git rev-parse HEAD > .git/current-commit"
return readFile(".git/current-commit").trim()
}
}
def setBuildStatus(String message, String state) {
step([
@begeeben
begeeben / .babelrc
Created November 2, 2017 09:26
babel build without bundling
{
"presets": [
"stage-1",
[
"env", {
"targets": {
"browsers": ["Chrome >= 61"],
"node": 6
},
"modules": "commonjs"
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@begeeben
begeeben / app.js
Created January 7, 2014 03:18
Angular UI Router url matching patterns
angular.module('app', ['ui.router'])
.config(['$locationProvider', '$stateProvider', '$urlRouterProvider',
function($locationProvider, $stateProvider, $urlRouterProvider) {
$locationProvider.html5Mode(true);
$urlRouterProvider
.when('/test?param1&param2', 'test/:param1/:param2')
.otherwise('/');
@begeeben
begeeben / touch-button.js
Last active December 11, 2015 04:28 — forked from phoboslab/touch-button.js
Made touch-button able to take different size buttons in one sprite sheet.
ig.module(
'plugins.touch-button'
)
.requires(
'impact.system',
'impact.input',
'impact.image'
)
.defines(function(){
// A Button Entity for Impact.js
ig.module( 'plugins.button' )
.requires(
'impact.entity'
)
.defines(function() {
Button = ig.Entity.extend({
size: { x: 80, y: 40 },
@begeeben
begeeben / javascript settings
Created October 23, 2015 15:26
sublime settings
{
// Determines what character(s) are used to terminate each line in new files.
// Valid values are 'system' (whatever the OS uses), 'windows' (CRLF) and
// 'unix' (LF only).
"default_line_ending": "unix",
// Set to "none" to turn off drawing white space, "selection" to draw only the
// white space within the selection, and "all" to draw all white space
"draw_white_space": "all",
{
"card_list": [
{
"type": "Deck",
"deckClass": "application",
"manifestURL": "app://app-deck.gaiamobile.org/manifest.webapp",
"group": "app"
},
{
"type": "Deck",
@begeeben
begeeben / develop.js
Last active August 29, 2015 14:26
A handly script to make and run Firefox OS Gaia. Watch for file changes and make on the fly.
// Usage: node make_onsave.js b2g tv browser
// node make_onsave.js nightly phone settings
// node make_onsave.js simulator tv tv-deck
// node make_onsave.js b2g tv
'use strict';
var fs = require('fs');
var path = require('path');
var exec = require('child_process').exec;

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).