Make sure You have open ssl
brew install openssl
export const TelephoneMask = (value) => { | |
return value | |
.replace(/\D/g, '') | |
.replace(/(\d{2})(\d)/, '($1) $2') | |
.replace(/(\d{4})(\d)/, '$1-$2') | |
.replace(/(\d{4})-(\d)(\d{4})/, '$1$2-$3') | |
.replace(/(-\d{4})\d+?$/, '$1') | |
} |
use October\Rain\Database\Attach\Resizer; | |
class ClassName extends Model{ | |
public $attachOne = [ | |
'img' => 'System\Models\File', | |
]; | |
public function afterSave(){ | |
$imgPath = $this->img->getLocalPath(); |
echo "CREATE SCRIPT" | |
echo '#!/bin/bash' >> october_install | |
echo "mkdir \$1 | |
cd \$1 | |
php -r \"eval('?>'.file_get_contents('https://octobercms.com/api/installer'));\" | |
" >> october_install | |
chmod +x october_install | |
echo "MOVE TO usr/local/bin" | |
sudo mv october_install /usr/local/bin |
@mixin respond-to($breakpoint) { | |
// If the key exists in the map | |
@if map-has-key($breakpoints, $breakpoint) { | |
// Prints a media query based on the value | |
@media #{inspect(map-get($breakpoints, $breakpoint))} { | |
@content; | |
} | |
} | |
// If the key doesn't exist in the map |
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); |
<?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"> |
/* | |
* In your plugin.php file add the following function | |
*/ | |
<?php | |
//... | |
public function registerMarkupTags() | |
{ | |
return [ | |
'functions' => [ |
#!/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 |
var mysql = require('mysql') | |
, async = require('async') | |
, config = require('config'); | |
var state = { | |
pool: null, | |
mode: null, | |
} | |
exports.connect = function(done) { |