Skip to content

Instantly share code, notes, and snippets.

<!-- https://www.facebook.com/NoelBautistaOfficial/ -->
.videofix {
position: relative;
padding-bottom: 56.25%;
margin:0px;
}
.videofix iframe {
<div style="padding-bottom: 56.25%;">
// put your groove video embed code here
</div>
@makerdude
makerdude / gist:884b0621cf106f7b64f20f5cfad103f3
Created February 26, 2019 03:36
How To Use UTM Parameters to Capture Lead Source
//https://jennamolby.com/how-to-use-utm-parameters-to-capture-lead-source/
// Parse the URL
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
// Give the URL parameters variable names
var source = getParameterByName('utm_source');
@makerdude
makerdude / PHPdatetime-roundup
Last active July 14, 2016 14:35
PHP round up time to the next min and the next 5 min
$now = time();
$nowstr = date('Y-m-d H:i:s',$now);
$next_five = date('Y-m-d H:i:s',ceil($now/300)*300);
$next_min = date('Y-m-d H:i:s',ceil($now/60)*60);
@makerdude
makerdude / docker-cheatsheet.txt
Last active July 2, 2016 01:04 — forked from abulovic/docker-cheatsheet.txt
Docker Cheatsheet
# Remove stopped containers
docker rm `docker ps --no-trunc -aq`
# Remove untagged images
docker images -q --filter "dangling=true" | xargs docker rmi
# Publish containers port to the host
docker run -p 443:8888 image/name
# Set environment variables
@makerdude
makerdude / ai-class.py
Created November 28, 2011 15:32
Download lecture videos of ai-class (with Subtitles) (Stanford)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Deepak.G.R."
__license__ = 'Public Domain'
"""
usage:
Go to command line and type
python ai-class.py "topic-name"
@makerdude
makerdude / gist:1400738
Created November 28, 2011 15:16 — forked from laclefyoshi/gist:769513
DNS server with Arduino and EthernetShield
// -*- mode: c++ -*-
/**
Copyright: (c) SAEKI Yoshiyasu
License : MIT-style license
<http://www.opensource.org/licenses/mit-license.php>
last updated: 2011/01/12
**/
#include <SPI.h>
@makerdude
makerdude / sketch_sprinkler.pde
Created November 28, 2011 15:12 — forked from tanmaykm/sketch_sprinkler.pde
Arduino Sprinkler Controller
// Arduino Sprinkler
// Version: 0.4 (beta)
// Updated: 03 Oct 2011
#include <LiquidCrystal.h>
#include <EEPROM.h>
// SWITCHES
// Pin 1 (Learn/Auto)
@makerdude
makerdude / gist:1400722
Created November 28, 2011 15:11
Nikon Arduino Remote
// ----- C -------
/**
* arduino Nikon IR remote
* @license Creative commons: Attribution-Noncommercial-Share Alike 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
* @author Aurelien ANTOINE
* version 1
* date 20081217
*
*
* This version modified by Steve Hoefer September 12, 2011
@makerdude
makerdude / gist:1400717
Created November 28, 2011 15:08 — forked from lpereira/gist:1324915
Arduino Charlieplexing
static const byte charlie_pins[] = {5, 6, 7};
static const byte charlie_led[][2] = {
{ 0, 1 },
{ 1, 0 },
{ 0, 2 },
{ 2, 0 },
{ 1, 2 },
{ 2, 1 }
};