Skip to content

Instantly share code, notes, and snippets.

View dfrankland's full-sized avatar
🏕️
Catching Pokemon

Dylan Frankland dfrankland

🏕️
Catching Pokemon
View GitHub Profile
@dfrankland
dfrankland / file_rename.py
Created December 24, 2014 19:55
Font Rename Files
import os
import shutil
import re
def changeFileName(files):
for file in files:
name = file.split("-")
extension = name[2].split(".")[1]
newFileName = ".".join([name[1],extension])
os.renames(file, newFileName)
@dfrankland
dfrankland / geocode-address-crossdomain.js
Last active August 29, 2015 14:13
Geocode Addresses Cross Domain using Google Maps API
var jquery = document.createElement('script');
jquery.src = "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jquery);
document.addEventListener("DOMContentLoaded", function(event) {
sheet = "title^is_active^phone^country_id^region^street^city^postal_code^desc^latitude^longitude^stores^website^icon^image^position\n";
$('.magasin').each(function(){
/*Dealer Name*/
$(this).children('.nom_mag').children('font').remove();
title = $(this).children('.nom_mag').text();
<svg preserveAspectRatio="xMinYMin" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 560 1388">
<defs>
<mask id="canTopMask">
<image width="560" height="1388" xlink:href="img/can-top-alpha.png"></image>
</mask>
</defs>
<image mask="url(#canTopMask)" id="canTop" width="560" height="1388" xlink:href="can-top.jpg"></image>
</svg>
@dfrankland
dfrankland / greenButton.html
Last active August 29, 2015 14:14
Green button for a website. http://jsfiddle.net/3jcqtyhb/1/
<html>
<head>
<style>
.greenButton {
-moz-box-shadow:inset 0px 0px 2px 2px #b4dd8e;
-webkit-box-shadow:inset 0px 0px 2px 2px #b4dd8e;
box-shadow:inset 0px 0px 2px 2px #b4dd8e;
background-color:#8ec748;
-moz-border-radius:4px;
-webkit-border-radius:4px;
@dfrankland
dfrankland / account_invoice_webkit.mako
Last active August 29, 2015 14:21
Some Mako Webkit Reports for OpenERP....
## -*- coding: utf-8 -*-
%for inv in objects :
<%def carriage_returns(text):
return text.replace('\n', '<br />')
%>
<% setLang(inv.partner_id.lang) %>
<html>
<head>
<style type="text/css">
${css}
@dfrankland
dfrankland / check-if-ip-changed.sh
Last active August 29, 2015 14:21
Check for changes in WAN ip using http://ifconfig.me
#!/bin/bash
ip1="";
ip2="";
changed=0;
date1=$( date "+%s" )
while true; do
ip1=$(curl -s ifconfig.me/ip);
if [[ "$ip1" != "$ip2" ]]; then
changed=$(( changed + 1 ));
date2=$( date "+%s" )
@dfrankland
dfrankland / gmail.sh
Created June 4, 2015 02:23
Automate Gmail SMTP login to send email via sh script.
#!/bin/sh
smtpsrv="smtp.gmail.com"
smtpport="587"
smtpusr=""
smtppwd=""
username64=$( echo $smtpusr | base64 ) # $( base64_encode $smtpusr )
password64=$( echo $smtppwd | base64 ) # $( base64_encode $smtppwd )
(
echo "EHLO localhost"; sleep 3;
@dfrankland
dfrankland / cPanel-Full-Backup.sh
Created June 30, 2015 01:16
Force cPanel Full Backup and tail the log
#!/bin/bash
sudo /usr/local/cpanel/bin/backup --force && sudo tail -f "$(sudo find /usr/local/cpanel/logs/cpbackup/ -maxdepth 1 -type f -printf "%T@ %p\n" | sort -n | tail -n 1 | cut -d' ' -f 2-)"
.
├── actions
├── stores
├── views
│   ├── Anonymous
│   │   ├── __tests__
│   │   ├── views
│   │   │   ├── Home
│   │   │   │   ├── __tests__
│   │   │   │   └── Handler.js
@dfrankland
dfrankland / .babelrc
Last active January 6, 2016 21:20
Gulp script to create precss compatible, global overrides for Bootstrap v4.
{
"presets": ["es2015"]
}