Skip to content

Instantly share code, notes, and snippets.

@iammart
iammart / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@iammart
iammart / Usage.php
Created October 25, 2012 09:03 — forked from ahoseinian/Usage.php
imageSaver
<?php
$imageSaver->setImage($_FILES['image'])->setName('test')->setPath("\images\\")->resize('auto',300)->save();
@iammart
iammart / gist:1fe85fe380beba64cb42
Created October 15, 2015 13:36 — forked from getify/gist:7ae82fdc2e86bf66bcba
List of ES6 books either out or in progress...

Adobe Edge Inspect Used while working on mobile/responsive sites to view natively on iPhone, updates in real time. https://chrome.google.com/webstore/detail/adobe-edge-inspect/ijoeapleklopieoejahbpdnhkjjgddem

Benchwarmer This has replaced my pinned Dribbble tab. "New tab" extension, no URL bar icon, transforms your new tab's background into a list of Dribbble popular/everyone/debut/following (you pick) shots. https://chrome.google.com/webstore/detail/benchwarmer-the-dribbble/lhdjhhpjicomphhjpehdhjenbaamdpnn

Bitly Used with custom .htaccess rule and vanity domain to shorten links with 2 clicks.

egrep -o 'dovecot_login[^ ]+' /var/log/exim_mainlog | sort|uniq -c|sort -nk 1
@iammart
iammart / protips.js
Created May 26, 2016 07:13 — forked from nolanlawson/protips.js
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@iammart
iammart / fix-wordpress-permissions.sh
Created June 28, 2017 14:55 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory

Install Supervisor with sudo apt-get install supervisor in Unix or brew install supervisor in Mac OSX. Ensure it's started with sudo service supervisor restart in Unix or brew services start supervisor in Mac OSX.

In Unix in /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

In Mac OSX first run supervisord -c /usr/local/etc/supervisord.ini and in /usr/local/etc/supervisor.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread in Unix and with: brew services restart supervisor in MAc OSX . And start using those changes with: sudo supervisorctl update.

@iammart
iammart / localhost-ssl.md
Created November 19, 2017 14:18 — forked from ethicka/localhost-ssl.md
Local virtualhost SSL websites on Mac OS Sierra

Local virtualhost SSL websites on Mac OS Sierra

These instructions will guide you through the process of setting up a wildcard SSL for your local virtualhosts for offline development. Most importantly, this configuration will give you the happy, green lock in Chrome.

These instructions have only been tested on Mac OS Sierra using the pre-installed Apache and PHP versions. These instructions also assume you have virtualhosts set up locally already.


Configuring SSL

@iammart
iammart / how-to-add-image-to-gist.md
Created January 5, 2018 12:23 — forked from remarkablemark/how-to-add-image-to-gist.md
How to add an image to a gist

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone git@gist.github.com:<hash>.git     # or with ssh