Skip to content

Instantly share code, notes, and snippets.

View andresbravog's full-sized avatar
💻

Andrés Bravo andresbravog

💻
View GitHub Profile
@andresbravog
andresbravog / script.js
Last active June 25, 2020 12:13
Do not allow to play video player unless user is logged in
(() => {
const intellumStopIframe = () => {
function getCookie(name) {
if (!name) { return false; }
if (!document.cookie) { return false; }
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) { return parts.pop().split(';').shift(); }
}
import pandas as pd
import numpy as np
from tensorflow.python.lib.io import file_io
import json
import csv
total_examples = 100
filename = './andres_bravo_dataset.csv'
# x4 mean and standard distribution values
mu, sigma = 0, 1
@andresbravog
andresbravog / 0_reuse_code.js
Created August 4, 2017 06:53
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
@andresbravog
andresbravog / Cloudformation.json
Last active September 19, 2017 02:29
ServerLess Article
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Cloud Formation Template for S3 based static site",
"Mappings": {
"RegionMap": {
"us-east-1": {
"S3hostedzoneID": "Z3AQBSTGFYJSTF",
"websiteendpoint": "s3-website-us-east-1.amazonaws.com"
},
"us-west-1": {
@andresbravog
andresbravog / gist:db56c900ba72cc1bed01
Last active August 29, 2015 14:14
Fix Heroku is not part of the Bundle Issue with RVM and Heroku Toolbelt
1 # Go to heroku exec file
sudo vim /usr/local/heroku/bin/heroku
2 # Change first line
#!/usr/local/heroku/ruby/bin/ruby
to
curl https://{subdomain}.zendesk.com/api/v2/tickets/{id}.json \
-H "Content-Type: application/json" \
-d '{"ticket":{"status":"solved", \
"comment":{"public":true, "body": "Thanks, this is now solved!"}}}' \
-v -u {email_address}:{password} -X PUT
@andresbravog
andresbravog / User.sublime-keymap
Created March 8, 2014 12:27
Theme and colorscheme keybind toggle
[
{
"keys": ["super+k", "super+c", "super+l"],
"command": "toggle_color_scheme",
"args":{
"options": [
{
"color_scheme": "Packages/User/Flatland Monokai (SL).tmTheme" ,
"theme": "Spacegray.sublime-theme"
},
@andresbravog
andresbravog / gist:8370726
Last active January 2, 2016 22:29
Install wp locally on mac with pow and pg

Install WordPress Locally on mac osx with pow and Postgres

1- Download pg server

Download postgress.app and run it

2- create database

Open psql, from the menubar elephant icon, and run...

@andresbravog
andresbravog / helpdesk_helper.js
Last active December 30, 2015 00:19
[Tampermonkey] Teambox helpdesk helper
// ==UserScript==
// @name Teambox Helpdesk Script
// @namespace http://redbooth.com/helpdesk
// @version 0.2.1
// @description enter something useful
// @match http://localhost:8000/a/index.html
// @match http://teambox.com/a*
// @match https://teambox.com/a*
// @match http://redbooth.com/a*
// @match https://redbooth.com/a*