Skip to content

Instantly share code, notes, and snippets.

View lelandsmith's full-sized avatar

Leland Smith lelandsmith

View GitHub Profile
@mobile-max: ~"only screen and (max-width: 550px)";
@tablet: ~"only screen and (min-width: 768px) and (max-width: 991px)";
@tablet-max: ~"only screen and (max-width: 767px)";
@tablet-min: ~"only screen and (min-width: 768px)";
@desktop: ~"only screen and (min-width: 992px) and (max-width: 1199px)";
@desktop-min: ~"only screen and (min-width: 992px)";
@desktop-max: ~"only screen and (max-width: 991px)";
@desktop-11-min: ~"only screen and (min-width: 1100px)";
@desktop-11-max: ~"only screen and (max-width: 1100px)";
@desktop-xl-min: ~"only screen and (min-width: 1200px)";

Bypass Wordpress Localhost FTP Connection Information

Do chown / chmod wordpress folder:

    $ sudo chown -R :_www wordpress
    $ sudo chmod -R g+w wordpress

Add the following line into wp-config.php:

@lelandsmith
lelandsmith / app.js
Last active February 16, 2018 19:18 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
@lelandsmith
lelandsmith / README.md
Created February 16, 2018 22:30 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@lelandsmith
lelandsmith / animations.js
Created February 23, 2018 21:27
JS Custom Trigger
$(document).ready(function(){
$("p").on("myOwnEvent", function(event, showName){
$(this).text(showName + "! What a beautiful name!").show();
});
$("button").click(function(){
$("p").trigger("myOwnEvent", ["Anja"]);
});
});
@lelandsmith
lelandsmith / Custom Trigger Event
Created February 23, 2018 21:39 — forked from fleimisch/Custom Trigger Event
Custom Trigger Event
/* place inside function */
jQuery.event.trigger('OverlayBoxonOpen');
/* call custom event */
$(document).bind('OverlayBoxonOpen', function () { alert('test') });
@lelandsmith
lelandsmith / wp-config.php
Created September 25, 2018 20:00 — forked from ifamily/wp-config.php
A universal WordPress wp-config.php which works on local development to staging and production server environments.
<?php
/*
One wp-config for local development to staging to production.
*/
// Define Environments
$environments = array(
@lelandsmith
lelandsmith / README.md
Created September 25, 2018 21:27 — forked from hofmannsven/README.md
Virtual Hosts with MAMP on OS X

Virtual Hosts

Update the hosts file in /etc/hosts to maintain multiple domains/hostnames on a local machine for 127.0.0.1 and setup a VirtualHost container in /Applications/MAMP/conf/apache/extra/httpd-vhost.conf via /Applications/MAMP/conf/apache/httpd.conf for a name-based virtual host.

Only suitable for MAMP users under OS X Lion, OS X Mountain Lion, and OS X Mavericks on Apache-Port 80 and MySQL-Port 3306.

@lelandsmith
lelandsmith / Multiple checkboxes for ruby array
Last active December 9, 2022 18:55
Multiple checkboxes for ruby array
#MODEL
serialize :storage_type
#CONTROLLER
:storage_type => []
#FORM
#STORE = model
<div class="field">