apt install bind9
Note: i have the IP : 192.168.1.109 by DHCP
edit the network settings file
app.filter('parseUrl', function() { | |
var //URLs starting with http://, https://, or ftp:// | |
replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim, | |
//URLs starting with "www." (without // before it, or it'd re-link the ones done above). | |
replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim, | |
//Change email addresses to mailto:: links. | |
replacePattern3 = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim; | |
return function(text, target, otherProp) { | |
angular.forEach(text.match(replacePattern1), function(url) { |
$ cd ~ | |
$ sudo curl -sS https://getcomposer.org/installer | sudo php | |
$ sudo mv composer.phar /usr/local/bin/composer | |
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer | |
then you can run | |
$ sudo composer install |
@app = angular.module 'myApp', [] | |
@app.filter "nrFormat", -> | |
(number) -> | |
if number!=undefined | |
console.log number | |
abs = Math.abs(number) | |
if abs >= Math.pow(10, 12) | |
# trillion | |
number = (number / Math.pow(10, 12)).toFixed(1)+"t" | |
else if abs < Math.pow(10, 12) and abs >= Math.pow(10, 9) |
#! /usr/bin/env bash | |
### | |
# | |
# install_mysql.sh | |
# | |
# This script assumes your Vagrantfile has been configured to map the root of | |
# your application to /vagrant and that your web root is the "public" folder | |
# (Laravel standard). Standard and error output is sent to | |
# /vagrant/vm_build.log during provisioning. |
String.prototype.toCamelCase = function(cap1st) { | |
'use strict'; | |
return ((cap1st ? '-' : '') + this).replace(/-+([^-])/g, function(a, b) { | |
return b.toUpperCase(); | |
}); | |
}; | |
function isCamelCase(str){ | |
'use strict'; |
var express = require('express'), | |
app = express(), | |
cookieParser = require('cookie-parser'), | |
session = require('express-session'), | |
RedisStore = require('connect-redis')(session); | |
app.use(express.static(__dirname + '/public')); | |
app.use(function(req, res, next) { | |
if (~req.url.indexOf('favicon')) | |
return res.send(404); |
CREATE TABLE IF NOT EXISTS `country` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`iso` char(2) NOT NULL, | |
`name` varchar(80) NOT NULL, | |
`nicename` varchar(80) NOT NULL, | |
`iso3` char(3) DEFAULT NULL, | |
`numcode` smallint(6) DEFAULT NULL, | |
`phonecode` int(5) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
// ESP8266 with 20x4 i2c LCD | |
// Compatible with the Arduino IDE 1.6.4 | |
// Library https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library | |
// Bavensky :3 | |
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x20,20,4); | |
<?php | |
class RetryTest extends TestCase | |
{ | |
public function setUp() | |
{ | |
parent::setUp(); | |
// abuse superglobal to keep track of state | |
$_GET['a'] = 0; | |
} |