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 / 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",
@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).

{
"card_list": [
{
"type": "Deck",
"deckClass": "application",
"manifestURL": "app://app-deck.gaiamobile.org/manifest.webapp",
"group": "app"
},
{
"type": "Deck",
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@begeeben
begeeben / jsbin.gogaj.css
Last active August 29, 2015 14:02
finite state machine example
.light {
display: inline-block;
position: relative;
background-color: black;
border: 3px solid #888;
border-radius: 50px;
width: 100px;
height: 100px;
margin: 3px;
}
.light {
display: inline-block;
border: 2px solid #888;
border-radius: 50px;
width: 100px;
height: 100px;
margin: 3px;
opacity: 0.3;
}