Skip to content

Instantly share code, notes, and snippets.

@Gregcop1
Gregcop1 / config.js
Created June 8, 2018 15:11
Import codepen to a remote branch
module.exports = {
repo: 'origin',
devBranch: 'master',
filePath: 'pages',
extensions: ['html', 'css'],
groups: [
{id: 1, pen: 'Gregcop1/pen/MXbzoK'},
]
};
@Gregcop1
Gregcop1 / pre-push
Last active November 30, 2017 23:10
Javascript project pre-push
#!/bin/sh
npm run prepush || {
echo
exit 1
}
@Gregcop1
Gregcop1 / coffee-doco-event.sublime-snippet
Last active August 29, 2015 14:22
Snippet to chain parameters documentation
<snippet>
<content><![CDATA[# @event ${1:name} ${2:description}
#]]></content>
<tabTrigger><![CDATA[#e]]></tabTrigger>
<scope>source.coffee</scope>
</snippet>
@Gregcop1
Gregcop1 / GitPrompt
Last active August 29, 2015 14:15
Git prompt
# Prompt
git_or_not() { git rev-parse --is-inside-work-tree &> /dev/null ; }
git_branch() {
local status="$(git status --porcelain 2> /dev/null)"
local color=''
if [[ "${status}" != "" ]]; then
color='\033[0;31m'
fi
echo -e "${color}$(git branch 2> /dev/null |grep -e ^* |sed 's/\* //')"
}
@Gregcop1
Gregcop1 / GitAliases
Created February 17, 2015 08:46
Git aliases
# Git Aliases
alias gcl='git clone'
alias ga='git add'
alias gall='git add .'
alias gus='git reset HEAD'
alias gm="git merge"
alias g='git'
alias get='git'
alias gst='git status'
alias gs='git status'
@Gregcop1
Gregcop1 / pageMediaWithFal
Created June 26, 2014 14:05
Get page's media in Typoscript with FAL system
10 = FILES
10 {
references {
table = pages
uid.field = uid
fieldName = media
}
maxItems = 1
renderObj = COA
renderObj {