Skip to content

Instantly share code, notes, and snippets.

@tonydieu
tonydieu / forms.html
Created July 1, 2016 07:21
wordpress forms dummy
<p><!-- Sample Content to Plugin to Template --></p>
<p>The purpose of this HTML is to help determine what default settings are with CSS and to make sure that all possible HTML Elements are included in this HTML so as to not miss any possible Elements when designing a site.</p>
<hr>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
<p><small><a href="#wrapper">[top]</a></small></p>
@tonydieu
tonydieu / gist:8456eabbdb3af04f71f0
Last active November 18, 2015 13:26
width fix/hack ms/mac broswer
// http://luxiyalu.com/window-innerwidth-vs-window-innerwidth/
var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
@tonydieu
tonydieu / blog.liquid
Created October 15, 2015 07:32
ligthbox shopify blog
<div>
{% if article.content contains "<img" %}
{% assign content-src = article.content | split: 'src="' %}
{% assign content-size = content-src.size | minus:1 %}
{% for i in (1..content-size) %}
{% assign src = content-src[i] | split: '"' | first | replace: '//cdn', 'http://cdn';;; | replace: 'http:http://';;;, 'http://';;; | remove: 'https:' %}
<a href="{{src}}" data-lightbox="{{article.id}}">
{% if i == 1 %}
<img src="{{src}}"/>
@tonydieu
tonydieu / gist:3dc79b4bb872e98270b9
Created October 10, 2015 17:16
WP - load files from production server when working locally
<IfModule mod_rewrite.c>
RewriteEngine on
# Attempt to load files from production if
# they're not in our local version
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule wp-content/uploads/(.*) \
http://{PROD}/wp-content/uploads/$1 [NC,L]
</IfModule>
https://www.dropbox.com/sh/ajd76hnomz97lx6/AABFYBMsY1H0EVKMhL-6Fl2Ka?dl=0
var express = require('express'),
path = require('path'),
favicon = require('serve-favicon'),
logger = require('morgan'),
cookieParser = require('cookie-parser'),
bodyParser = require('body-parser'),
request = require('request'),
CronJob = require('cron').CronJob,
_ = require('lodash'),
uuid = require('node-uuid'),
@tonydieu
tonydieu / .jscs.json
Last active August 29, 2015 14:18
jscs config
{
"requireCurlyBraces": ["if", "else", "for", "while", "do"],
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"requireSpacesInsideObjectBrackets": "all",
"requireSpacesInsideArrayBrackets": "all",
{
"_id": {
"$oid": "55190028d56ac50300406e9d"
},
"source": "gamespot",
"feed": [
{
"uuid": "5de4f900-d6b1-11e4-9d73-85eeb38883a3",
"isActive": true,
"tags": [],
{
"_id": {
"$oid": "551872a2fbfda10300cfef00"
},
"source": "gamespot",
"feed": [
{
"uuid": "038fdd20-d65d-11e4-9cbe-cd97e1126a10",
"isActive": true,
"tags": [],
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.5.0/lodash.min.js"></script>
<script id="jsbin-javascript">