Make sure You have open ssl
brew install openssl
#!/bin/bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev zsh | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz | |
tar -xvzf ruby-1.9.3-p392.tar.gz | |
cd ruby-1.9.3-p392 | |
./configure --prefix=/usr/local | |
make | |
make install |
File: adm/category.rb | |
===================== | |
class Adm::Category < ActiveRecord::Base | |
has_one :adm_modalcategory | |
end | |
File: adm/modalcategory.rb | |
========================== |
server { | |
listen 80; | |
server_name serasa.vbeta.com.br; | |
underscores_in_headers on; | |
location / { | |
proxy_pass http://192.170.0.216; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_pass_request_headers on; |
// Import express | |
const express = require('express'); | |
const app = express(); | |
app.get('/', (req, res) => { | |
res.send('<h1>Hello World from Node</h1>'); | |
}) | |
app.listen(3000,() => { | |
console.log('Listening on port 3000'); |
var mysql = require('mysql') | |
, async = require('async') | |
, config = require('config'); | |
var state = { | |
pool: null, | |
mode: null, | |
} | |
exports.connect = function(done) { |
#!/bin/env bash | |
MY_PATH=$(pwd) | |
PORT=${1:-8080} | |
docker run -p $PORT:2368 -v $MY_PATH:/var/lib/ghost/content --env NODE_ENV=development ghost |
/* | |
* In your plugin.php file add the following function | |
*/ | |
<?php | |
//... | |
public function registerMarkupTags() | |
{ | |
return [ | |
'functions' => [ |
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="Imported Rule 1" stopProcessing="true"> | |
<match url="themes/.*/(layouts|pages|partials)/.*.htm" /> | |
<action type="Rewrite" url="index.php" /> | |
</rule> | |
<rule name="Imported Rule 2" stopProcessing="true"> |
function distance(lat1, lon1, lat2, lon2, unit) { | |
if ((lat1 == lat2) && (lon1 == lon2)) { | |
return 0; | |
} | |
else { | |
var radlat1 = Math.PI * lat1/180; | |
var radlat2 = Math.PI * lat2/180; | |
var theta = lon1-lon2; | |
var radtheta = Math.PI * theta/180; | |
var dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta); |