Skip to content

Instantly share code, notes, and snippets.

@marinhero
marinhero / cloudSettings
Last active July 6, 2017 20:35
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-07-06T20:35:54.428Z","extensionVersion":"v2.8.2"}
FROM ubuntu:14.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y --no-install-recommends software-properties-common && add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
(echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections) && \
apt-get install --no-install-recommends -y oracle-java8-installer && \
rm -rf /var/cache/oracle-jdk8-installer && \
@marinhero
marinhero / encoding.html
Created February 13, 2017 20:13
SVG encode exampe
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ENCODING TEST</title>
<style>
.icon {
background:
url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTTE2IDMuNTM4Yy0wLjU4OCAwLjI2My0xLjIyMiAwLjQzOC0xLjg4NCAwLjUxNiAwLjY3OC0wLjQwNiAxLjE5Ny0xLjA1MCAxLjQ0NC0xLjgxNi0wLjYzNCAwLjM3NS0xLjMzOCAwLjY1LTIuMDg0IDAuNzk3LTAuNi0wLjYzOC0xLjQ1My0xLjAzNC0yLjM5Ny0xLjAzNC0xLjgxMyAwLTMuMjgxIDEuNDY5LTMuMjgxIDMuMjgxIDAgMC4yNTYgMC4wMjggMC41MDYgMC4wODQgMC43NDctMi43MjgtMC4xMzgtNS4xNDctMS40NDQtNi43NjYtMy40MzEtMC4yODEgMC40ODQtMC40NDQgMS4wNTAtMC40NDQgMS42NSAwIDEuMTM4IDAuNTc4IDIuMT

Keybase proof

I hereby claim:

  • I am marinhero on github.
  • I am marinhero (https://keybase.io/marinhero) on keybase.
  • I have a public key ASATO0nENxjAsTasxwaHbRdrQg2FkU-fX96K2WlZS8PjlAo

To claim this, I am signing this object:

@marinhero
marinhero / analytics.js
Last active February 8, 2017 17:50
An Example of the analytics.js module in the beacon.
define(['jquery'], function(jq){
//Edited for readability purposes
var $ = jq.noConflict(true);
var initialize = function() {
pixel();
google();
};
/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,
def populate_array(n)
arr = Array.new(n, true)
arr[0] = false
arr[1] = false
arr
end
def print_array(a)
count = 0
while count < a.length
@marinhero
marinhero / wpPerm.sh
Last active August 29, 2015 14:23
Wordpress permissons
#!/bin/bash
USER=$1
find /home/$USER/public_html/ -type f -exec chmod 644 {} +
find /home/$USER/public_html/ -type d -exec chmod 775 {} +
chmod 640 /home/$USER/public_html/wp-config.php
chgrp -R www-data /home/$USER/public_html/
#!/bin/bash
#Author: Marin Alcaraz
#Fast LEMP stack install
apt-get -y update
apt-get -y upgrade
apt-get install -y mysql-server php5-mysql
mysql_install_db
@marinhero
marinhero / gist:7aa7b5e62398c7f0a400
Created February 16, 2015 22:12
Vim Go bindings
"vim-Go
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
au FileType go nmap <Leader>s <Plug>(go-implements)
au FileType go nmap <Leader>i <Plug>(go-info)
au FileType go nmap <Leader>gd <Plug>(go-doc)
au FileType go nmap <Leader>gv <Plug>(go-doc-vertical)
au FileType go nmap <Leader>gb <Plug>(go-doc-browser)