Skip to content

Instantly share code, notes, and snippets.

View metalvegetarianoprogresivo's full-sized avatar
:octocat:
if you can read this you also can read the documentation

irving.gomez metalvegetarianoprogresivo

:octocat:
if you can read this you also can read the documentation
View GitHub Profile

Palindrome

Task

Create a function that receives a word and based on that word returns a boolean value if it is true or false.

Input Format

Data Type Parameter Description
String parameterVariable The word that will be evaluated if it is a palindrome or not.
@metalvegetarianoprogresivo
metalvegetarianoprogresivo / prettyprintgist.md
Created December 21, 2016 18:11 — forked from magnetikonline/README.md
Bookmarklet to pretty print Gist pages without the usual page chrome, just content. Handy for Markdown document printing.

Pretty print bookmarklet helper for Gist pages

Create a new bookmark somewhere handy in your browser with the following URL:

javascript:var el=document.createElement('style');el.media='print';el.innerHTML='#header,.pagehead.repohead,.gist-description.container,.file-box .meta,#comments,.js-comment-form,#footer{display:none;}.file-box{border:0!important;}';document.getElementsByTagName('head')[0].appendChild(el);alert('Please consider the environment before printing :)');
  • Navigate to your Gist of choice
  • Hit the bookmarklet
  • Now print
@metalvegetarianoprogresivo
metalvegetarianoprogresivo / getBlob.js
Created August 11, 2016 20:36
Get blob from baseg4/image
function getBlob (dataURL) {
var BASE64_MARKER = ';base64,';
if (dataURL.indexOf(BASE64_MARKER) == -1) {
var parts = dataURL.split(',');
var contentType = parts[0].split(':')[1];
var raw = decodeURIComponent(parts[1]);
return new Blob([raw], { type: contentType });
}
var parts = dataURL.split(BASE64_MARKER);
var contentType = parts[0].split(':')[1];
@metalvegetarianoprogresivo
metalvegetarianoprogresivo / check_docker_container.sh
Created April 23, 2016 18:08 — forked from ekristen/check_docker_container.sh
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# The script checks if a container is running.
# OK - running
@metalvegetarianoprogresivo
metalvegetarianoprogresivo / parse_yaml.sh
Created April 12, 2016 19:29 — forked from pkuczynski/parse_yaml.sh
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]}}
@metalvegetarianoprogresivo
metalvegetarianoprogresivo / GitHub curl.sh
Created March 18, 2016 17:31 — forked from Integralist/GitHub curl.sh
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"
@metalvegetarianoprogresivo
metalvegetarianoprogresivo / 0_reuse_code.js
Created January 12, 2016 14:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console