Skip to content

Instantly share code, notes, and snippets.

View Minasokoni's full-sized avatar
:octocat:

Robert Barnwell Minasokoni

:octocat:
View GitHub Profile
@Minasokoni
Minasokoni / widget.js
Created October 3, 2017 22:38 — forked from lukencode/widget.js
Starter template for creating jsonp embeddable widgets.
(function () {
var scriptName = "embed.js"; //name of this script, used to get reference to own tag
var jQuery; //noconflict reference to jquery
var jqueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js";
var jqueryVersion = "1.8.3";
var scriptTag; //reference to the html script tag
/******** Get reference to self (scriptTag) *********/
var allScripts = document.getElementsByTagName('script');
@Minasokoni
Minasokoni / max_width_email.html
Created May 15, 2017 19:22 — forked from elidickinson/max_width_email.html
Email Template trick: max-width with outlook
<!--[if mso]>
<center>
<table><tr><td width="580">
<![endif]-->
<div style="max-width:580px; margin:0 auto;">
<p>This text will be centered and constrained to 580 pixels even on Outlook which does not support max-width CSS</p>
</div>
<!--[if mso]>
@Minasokoni
Minasokoni / base.js
Created February 28, 2017 16:55
Webpack Config
const webpack = require('webpack')
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const src = path.join(__dirname, '../app')
const nodeModules = path.join(__dirname, '../node_modules')
module.exports = function () {
return {
entry: {
@Minasokoni
Minasokoni / cf7.php
Created October 10, 2016 17:21
contact form 7 - salesforce
add_action( 'wpcf7_before_send_mail', 'my_conversion' );
function my_conversion( $cf7 )
{
$email = $cf7->posted_data["your-email"];
$first_name = $cf7->posted_data["first-name"];
$last_name = $cf7->posted_data["last-name"];
$phone = $cf7->posted_data["your-phone"];
$where = $cf7->posted_data["text-wheredoyouwanttogo"];
$when = $cf7->posted_data["your-whendoyouwanttogo"];
$referred = $cf7->posted_data["your-referredby"];
{
"settings": {
"root": {
"pathToSassDirectory": "app/",
"sassDirectory": "styles",
"sassImportFile": "main.scss"
},
"modules": {
"modulesDirectory": "components",
"modulesImportFile": "_components.scss",
@Minasokoni
Minasokoni / .gitignore
Created May 11, 2016 14:51 — forked from salcode/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@Minasokoni
Minasokoni / genesis
Last active September 3, 2019 05:09
New Computer Setup
#!/bin/bash
# Don't forget to chmod a+x genesis.sh
# Install Homebrew + Cask
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap caskroom/cask
brew install cask
brew update && brew upgrade brew-cask && brew cleanup
Handlebars.registerHelper ('truncate', function (str, len) {
if (str.length > len) {
var new_str = str.substr (0, len+1);
while (new_str.length) {
var ch = new_str.substr ( -1 );
new_str = new_str.substr ( 0, -1 );
if (ch == ' ') {
break;
@Minasokoni
Minasokoni / vhost
Created August 13, 2014 17:01 — forked from gistwebdev/vhost
#!/bin/bash
#
# Display usage info
vhost-usage() {
cat <<"USAGE"
Usage: vhost [OPTIONS] <name>
-h|--help this screen
-pub to create the webhost root in ~/www/name/public/
-url to specify a local address, default is http://name.local
var bgColor = '#163596',
bgImg = 'http://i.imgur.com/7MDjqNU.jpg';
var space = window.parent.document.body,
ad = space.querySelectorAll('#AD'),
adClickURL = '%%CLICK_URL_UNESC%%';
space.style.backgroundColor = bgColor;
space.style.backgroundImage = 'url(%%VIEW_URL_UNESC%%' + bgImg + '?v=%%CACHEBUSTER%%)';