This is pretty simple, lets dive in!
Find a name that isn't taken and clearly describes what your module is doing
$ npm view your-first-node-module
I posted several talks about compiling PHP from source, but everyone was trying to convince me that a package manager like Homebrew was a more convenient way to install.
The purpose of Homebrew is simple: a package manager for macOS that will allow you to set up and install common packages easily and allows you to update frequently using simple commands.
I used a clean installation of macOS Sierra to ensure all steps could be recorded and tested. In most cases you already have done work on your Mac, so chances are you can skip a few steps in this tutorial.
I’ve made this according to the installation instructions given on GetGrav.
// ---- | |
// Sass (v3.3.0.rc.1) | |
// Compass (v0.13.alpha.10) | |
// ---- | |
$max: 100; | |
@for $i from 1 through $max / 2 { | |
$value: $i * 2 - 1; | |
.test_#{$value} { index: $i; value: $value; } |
// ---- | |
// Sass (v3.3.0.rc.1) | |
// Compass (v0.13.alpha.10) | |
// ---- | |
$max: 100; | |
@for $i from 1 through $max / 2 { | |
$value: $i * 2 - 1; | |
.test_#{$value} { index: $i; value: $value; } |
# run_multiple_commands.py | |
import sublime, sublime_plugin | |
# Takes an array of commands (same as those you'd provide to a key binding) with | |
# an optional context (defaults to view commands) & runs each command in order. | |
# Valid contexts are 'text', 'window', and 'app' for running a TextCommand, | |
# WindowCommands, or ApplicationCommand respectively. | |
class RunMultipleCommandsCommand(sublime_plugin.TextCommand): | |
def exec_command(self, command): | |
if not 'command' in command: | |
raise Exception('No command name provided.') |
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
This solution fixes the error caused by trying to run npm update npm -g
. Once you're finished, you also won't need to use sudo
to install npm modules globally.
Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.
```php | |
// Render persistence data before form output | |
add_filter("gform_pre_render", "ri_pre_populate_the_form"); | |
function ri_pre_populate_the_form($form) { | |
if (gfdp_is_persistent($form)) { | |
$current_page = GFFormDisplay::get_current_page($form["id"]); | |
if ($current_page == 1) { | |
$option_key = ri_getFormOptionKeyForGF($form); | |
if (get_option($option_key)) { | |
$persistent_info = json_decode(get_option($option_key)); |
upstream phpfpm { | |
server unix:/var/run/php5-fpm.sock; | |
} | |
upstream hhvm { | |
server unix:/var/run/hhvm/hhvm.sock; | |
} | |
# SSL | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
/** | |
* Object.prototype.watch polyfill | |
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/watch | |
* | |
* Known limitations: | |
* - `delete object[property]` will remove the watchpoint | |
* | |
* Based on Eli Grey gist https://gist.github.com/eligrey/384583 | |
* Impovements based on Xose Lluis gist https://gist.github.com/XoseLluis/4750176 | |
* This version is optimized for minification |