Skip to content

Instantly share code, notes, and snippets.

View hankpillow's full-sized avatar

igor hankpillow

View GitHub Profile
@hankpillow
hankpillow / index.js
Last active May 19, 2020 19:57
Lambda for Bitbucket webhook with Google Chat
var https = require('https');
var parse = require("url").parse;
exports.handler = async (data) => {
const chatURL = process.env.CHAT_URL
if (!chatURL){
return {
statusCode: 400,
body: JSON.stringify('missing google chat webhook'),
@hankpillow
hankpillow / provision-docker.yml
Created November 13, 2018 16:19
ansible playbook with mysql
---
- name: Create container
hosts: localhost
gather_facts: yes
tasks:
- name: Create Drupal container
register: new_container
docker_container:
privileged: yes
state: started
(function() {
var timer = 0;
var screenViewport = window.innerHeight;
var documentHeight = document.documentElement.scrollHeight;
var scrollPositions = {
0: 0,
25: parseInt((documentHeight / 100) * 25, 10),
50: parseInt((documentHeight / 100) * 50, 10),
75: parseInt((documentHeight / 100) * 75, 10),
100: parseInt(documentHeight - (screenViewport / 2), 10)
console.log('hello-console')
thisYear="2016"
nextYear="$thisYear"
for month in {1..12};
do
nextMonth=$(expr 1 + $month)
if [ "$month" -eq 12 ];
then
nextYear=$(expr 1 + $thisYear)
nextMonth="1"
fi
scriptencoding utf-8
if has('vim_starting')
if &compatible
set nocompatible
endif
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
function! StripTrailingWhitespace()
@hankpillow
hankpillow / colorst
Last active December 21, 2015 02:29
#!/bin/bash
black="\033[30m"
gray="\033[37m"
light_gray="\033[97m"
dark_gray="\033[30m"
light_dark_gray="\033[90m"
@hankpillow
hankpillow / regex-url-params
Created June 3, 2011 19:53
matches in a group all parameters and values in a URL
(\w*)=([^#&]+)
@hankpillow
hankpillow / html centering content
Created April 20, 2011 15:15
i know there is a bunch of css tricks to do this, but this way always worked for me!
<!DOCTYPE html>
<html xml:lang="pt-BR" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script src="js/swfobject.js" type="text/javascript" charset="utf-8"></script>
<style type="text/css" media="screen">
@hankpillow
hankpillow / create-htaccess
Created April 1, 2011 19:06
this script creates htaccess files in the same root as when you called this script
#!/bin/bash
user=$1;
if [ "$user" = "" ]
then
echo -n "user name:"
read user
fi
pwd | awk '{root = $1}; END {print "AuthName \"Secure Area\"\nAuthType Basic\nAuthUserFile " root "/.htpasswd\nrequire valid-user" }' > .htaccess