Skip to content

Instantly share code, notes, and snippets.

View bensochar's full-sized avatar
🗜️
coding...

Benjamin Sochar bensochar

🗜️
coding...
View GitHub Profile
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@bensochar
bensochar / jQuery Checkbox Change
Last active August 29, 2015 13:56
jQuery snippet to Detect Checkbox Changes
jQuery(document).ready(function($) {
$(':checkbox').checkedChange();
});
(function($) {
/*
* Detect Checkbox Changes
*/
$.fn.checkedChange = function (_class) {
_class = _class || "checked";
@bensochar
bensochar / jQuery Wrap Checkboxes
Created February 25, 2014 19:19
Wrap Checkbox Inputs so you can style them.
jQuery(document).ready(function($) {
$(':checkbox').wrapCheckboxInputs();
});
(function($) {
$.fn.wrapCheckboxInputs = function() {
return this.each(function () {
var _label = $(this).closest("label.checkbox");
var _nme = this.name;
var _id = this.id;
$(this).wrap('<div class="box" data-id="'+_id+'"></div>').wrap('<div class="check" data-id="'+_id+'"></div>');
@bensochar
bensochar / jQuery Checkbox Change for oldies
Last active August 29, 2015 13:56
jQuery to detect checkbox change on older browsers. Uses a conditional class on the html tag.
jQuery(document).ready(function($) {
$('label :checkbox').checkedChange();
$('label :checkbox').wrapCheckboxInputs();
$('label :radio').radioChange();
});
(function($) {
$.fn.wrapRadioInputs = function() {
return this.each(function() {
var _label = $(this).closest("label.radio");
@bensochar
bensochar / GA Tracking
Created February 28, 2014 18:27
GA Tracking Code via data attributes
/* global _gaq:false */
var H5BP = H5BP || {};
// Google Analytics event tracking
H5BP.track = (function () {
'use strict';
$(function () {
@bensochar
bensochar / start_redis_posgres_foreman.sh
Created June 18, 2015 17:52
start redis posgres foreman
#!/bin/bash
#echo on
set -x
echo load postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
echo start redis
redis-server /usr/local/etc/redis.conf --daemonize yes
@bensochar
bensochar / resume.json
Last active June 27, 2019 14:51
{ "theme": "paper"}
{
"basics": {
"name": "Ben Sochar",
"label": "Full Stack",
"summary": "Full stack web developer always eager for more",
"website": "http://bensochar.com",
"email": "bsochar@gmail.com",
"location": {
"city": "New York",
"countryCode": "US"
@bensochar
bensochar / Gradient.js
Created October 25, 2021 14:51 — forked from jordienr/Gradient.js
Stripe Mesh Gradient WebGL
/*
* Stripe WebGl Gradient Animation
* All Credits to Stripe.com
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and
* commented out for now.
* https://kevinhufnagl.com
*/