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 | |
/** | |
* QR Code + Logo Generator | |
* | |
* http://labs.nticompassinc.com | |
*/ | |
$data = isset($_GET['data']) ? $_GET['data'] : 'http://labs.nticompassinc.com'; | |
$size = isset($_GET['size']) ? $_GET['size'] : '200x200'; | |
$logo = isset($_GET['logo']) ? $_GET['logo'] : FALSE; |
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
# Automatically instal the latest nginx | |
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add - | |
#Make a backup copy of your current sources.list file | |
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak | |
#Now copy the following repositories to the end of ` /etc/apt/sources.list` | |
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list | |
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list |
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 | |
$countries = array | |
( | |
'AF' => 'Afghanistan', | |
'AX' => 'Aland Islands', | |
'AL' => 'Albania', | |
'DZ' => 'Algeria', | |
'AS' => 'American Samoa', | |
'AD' => 'Andorra', |
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React, { Component, PropTypes } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, |
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
import React, { Component, PropTypes } from 'react'; | |
import { View, Text, TouchableHighlight } from 'react-native'; | |
export default class MyScene extends Component | |
{ | |
static propTypes = { | |
title: PropTypes.string.isRequired, | |
onForward: PropTypes.func.isRequired, | |
onBack: PropTypes.func.isRequired, | |
} |
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
user nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; |
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 | |
$serverName = 'localhost'; | |
$userName = 'root'; | |
$password = 'a'; | |
$dbName = 'test'; | |
$conn = new mysqli($serverName, $userName, $password, $dbName); | |
if ($conn->connect_error) { | |
die ('Connection failed' . $conn->connect_error); |
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
add_action('template_redirect', 'redirect_to_cart_page'); | |
function redirect_to_cart_page() | |
{ | |
if (is_checkout() and !is_user_logged_in()) { | |
$carts = WC()->cart->get_cart(); | |
if (!empty($carts)) { | |
foreach ( $carts as $cart) |
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
# Client, generate a ssh key pair if needed | |
ssh-keygen | |
# Copy public key to server | |
ssh-copy-id username@IP | |
# Disable the Password for Root Login on server | |
sudo nano /etc/ssh/sshd_config | |
--> PermitRootLogin without-password | |
reload ssh |
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
Create user deploy | |
sudo useradd deploy | |
sudo usermod -a -G sudo deploy | |
Login as deploy user | |
su deploy | |
Install RVM | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB |
OlderNewer