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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> | |
<script type="text/javascript" src="jquery-1.7.1.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function () { | |
$.getJSON('estados_cidades.json', function (data) { |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^index\.php$ - [L] | |
RewriteRule (.*) ./index.php?id=$1 [L] | |
</IfModule> |
<?php | |
/** | |
* Close the connection to the browser but continue processing the operation | |
* @param $body | |
*/ | |
public function closeConnection($body, $responseCode){ | |
// Cause we are clever and don't want the rest of the script to be bound by a timeout. | |
// Set to zero so no time limit is imposed from here on out. | |
set_time_limit(0); |
# Remove foreman | |
yum remove remove foreman foreman-installer foreman-proxy | |
rm -rf /var/lib/foreman /usr/share/foreman /usr/share/foreman-proxy/logs | |
rm /etc/httpd/conf.d/foreman.conf | |
# Remove puppet | |
yum remove puppet puppetmaster puppet-common puppetmaster-common puppetlabs-release | |
rm -rf /usr/lib/ruby/vendor_ruby/puppet /usr/share/puppet /var/lib/puppet /etc/puppet | |
rm /etc/apache2/conf.d/puppet.conf |
# | |
# Avoid the message 'External file changes sync may be slow: The current inotify(7) watch limit is too low.' from JetBrains products. | |
# | |
# 1. Create the file /etc/sysctl.d/60-jetbrains.conf and paste this code | |
# 2. Restart the sysctl service: sudo sysctl -p --system | |
# 3. Restart the IDE | |
# | |
# More info: | |
# https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit |
public function convertMongoDBCursorToArray($dbcursor) { | |
$counter=0; $x=0; | |
$finalarray = Array() ; $convertedarray=Array() ; | |
foreach($dbcursor as $document) { $finalarray[$counter]=$document; $counter++;} | |
$finalarray=array_values($finalarray); | |
$thissize = count($finalarray); | |
$counter=0; |