# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function stringify(obj, whitespace, isChild) { | |
if (!obj) { | |
return 'null'; | |
} | |
var output = (obj instanceof Array ? '[' : '{') + '\n'; | |
for (var i = 0, keyList = Object.keys(obj), l = keyList.length; i < l; i++ ) { | |
var key = keyList[i]; | |
var prop = obj[key]; | |
var stringifyValue = 'null'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$log = shell_exec('git log'); | |
preg_match('/commit\s(.*+)/', $log, $result); | |
$lastedCommit = $result[1]; | |
preg_match('/commit\s(.*+)\nMerge/', $log, $result); | |
$startCommit = $result[1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 给一个数组,将他填充到指定长度 | |
* @param array $arr | |
* @param number $needNumber | |
* @return array | |
* @author marlon marlon@tfan.net | |
*/ | |
function padArray($array, $needNumber) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
mkdir /etc/nginx/ssl 2>/dev/null | |
openssl genrsa -out "/etc/nginx/ssl/$1.key" 1024 2>/dev/null | |
openssl req -new -key /etc/nginx/ssl/$1.key -out /etc/nginx/ssl/$1.csr -subj "/CN=$1/O=Vagrant/C=UK" 2>/dev/null | |
openssl x509 -req -days 365 -in /etc/nginx/ssl/$1.csr -signkey /etc/nginx/ssl/$1.key -out /etc/nginx/ssl/$1.crt 2>/dev/null | |
block="server { | |
listen ${3:-80}; | |
listen ${4:-443} ssl; |
#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.
Run the following commands in sequence.
sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"crypto/cipher" | |
"crypto/des" | |
"encoding/base64" | |
"fmt" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"bootstrapped": true, | |
"http_proxy": "127.0.0.1:1087", | |
"in_process_packages": | |
[ | |
], | |
"installed_packages": | |
[ | |
"A File Icon", | |
"Alignment", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [{ | |
"name": "Listen for XDebug", | |
"type": "php", | |
"request": "launch", | |
"port": 9009, | |
"localSourceRoot": "${workspaceRoot}/public", | |
"serverSourceRoot": "/home/vagrant/Code/forzu-be/public" | |
}, |
OlderNewer