Skip to content

Instantly share code, notes, and snippets.

View jgermade's full-sized avatar
🎨
Working from home

Jesús Germade jgermade

🎨
Working from home
View GitHub Profile
@jgermade
jgermade / checkout.json
Last active February 21, 2017 12:22
checkout.json
{
"toc": true,
"merchant": {
"confirmation_url": "https://demo.aplazame.com/confirm",
"cancel_url": "/demo-cancel.html",
"success_url": "/demo-success.html"
},
"customer": {
"id": "140",
"email": "[email protected]",
@jgermade
jgermade / alias.sh
Last active July 11, 2022 01:36
sh
alias ll='ls -alF'
alias l='ls -alF'
alias c='clear'
alias .='echo $PWD'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
@jgermade
jgermade / angular-web-component.js
Last active January 31, 2017 14:38
web components playground
angular.module('web.components', []).factory('webComponent', function ($templateCache, $compile) {
function getAttributes (element) {
var $attrs = {}, attrs = element.attributes;
for( var i = 0, len = attrs.length; i < len ; i++ ) {
$attrs[attrs[i].name.replace(/([a-z])-([a-z])/, function (match, a, z) {
return a + z.toUpperCase();
})] = attrs[i].value;
}
return $attrs;
@jgermade
jgermade / atom-custom-style.less
Created October 8, 2015 13:57
Atom - Custom style
atom-text-editor, :host {
background-color: #000000;
}
// style the background color of the tree view
.tree-view {
// background-color: whitesmoke;
font-size: 1.3rem;
font-family: monospace;
}
@jgermade
jgermade / parse_yaml.sh
Last active August 9, 2016 22:13 — forked from pkuczynski/LICENSE
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
@jgermade
jgermade / install-pre-commit.sh
Last active August 27, 2015 09:12 — forked from stefansundin/install-pre-commit.sh
Git pre-commit check to stop accidental commits to master and develop branches. There is also a variant with a core.whitespace check.
#!/bin/sh
# This script will install a Git pre-commit hook that stop accidental commits to master and develop branches.
# There is also a variant that includes a core.whitespace check. See pre-commit-2 below.
# Install in current Git repo:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh
# Install with core.whitespace check:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-2
# Install with core.whitespace check and EOF-newline-check:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-3
# Install only core.whitespace check:
@jgermade
jgermade / _service.md
Last active August 29, 2015 14:25 — forked from naholyr/_service.md

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@jgermade
jgermade / crypt flow
Last active August 29, 2015 14:21
CryptZ
sha3-512
answer: sha( question + sha(pass) )
aes-psk: sha( sha(pass) + question )
Authentication: Bearer {ACCESS_TOKEN}
X-Request: uuid.v4
X-Signature: aes(request.uuid, aes-psk)
Payload: aes(payload, aes-psk)
@jgermade
jgermade / .gitconfig
Last active August 29, 2015 14:17 — forked from pksunkara/config
[user]
name = Pavan Kumar Sunkara
email = [email protected]
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com