- Initial Server Setup with Ubuntu 12.04
- How To Install Linux, nginx, MySQL, PHP (LEMP) stack on Ubuntu 12.04
- A Basic MySQL Tutorial
- How To Install phpMyAdmin on a LEMP server
- How To Install Git on Ubuntu 12.04
- Generating SSH Keys and connect with DigitalOcean
- Install Composer on DigitalOcean
- [Install php5-cli if you get stuck with installing Compos
This file contains hidden or 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
# KILL THEM ETAGS | |
# http://www.askapache.com/htaccess/apache-speed-etags.html | |
FileETag none | |
# set expires header | |
<FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf|woff|eot|svg|ttf)$"> | |
Header set Expires "Tue, 16 Jun 2020 20:00:00 GMT" | |
</FilesMatch> | |
# turn on gzip compression |
This file contains hidden or 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 and group used by worker processes | |
user www-data; | |
# Ideally # of worker processes = # of CPUs or cores | |
# Set to auto to autodetect | |
# max_clients = worker_processes * worker_connections | |
worker_processes auto; | |
pid /run/nginx.pid; |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am mirzalazuardi on github. | |
* I am mirzalazuardi (https://keybase.io/mirzalazuardi) on keybase. | |
* I have a public key ASCzDoTqBV31bYSm2slkGSLd6XZFA5irVOtCS4xaihKFngo | |
To claim this, I am signing this object: |
This file contains hidden or 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
-- Workers | |
-- The following data definition defines an organization's employee hierarchy. An employee is a manager if any other employee has their managerId set to the first employees id. An employee who is a manager may or may not also have a manager. | |
-- TABLE employees | |
-- id INTEGER NOT NULL PRIMARY KEY | |
-- managerId INTEGER REFERENCES employees(id) | |
-- name VARCHAR(30) NOT NULL | |
-- Write a query that selects the names of employees who are not managers. | |
SELECT * | |
FROM employees | |
WHERE id IN (SELECT id FROM employees WHERE managerId IS NULL) |
This file contains hidden or 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
-- Students | |
-- Given the following data definition, write a query that returns the number of students whose first name is John. | |
-- TABLE students | |
-- id INTEGER PRIMARY KEY, | |
-- firstName VARCHAR(30) NOT NULL, | |
-- lastName VARCHAR(30) NOT NULL | |
SELECT COUNT(*) AS numOfStudent | |
FROM students | |
WHERE firstName = 'John' |
This file contains hidden or 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 | |
/**A palindrome is a word that reads the same backward or forward. Write a function that checks if a given word is a palindrome. | |
* Character case should be ignored. For example, isPalindrome("Deleveled") should return true as character case should be ignored, resulting in "deleveled", which is a palindrome since it reads the same backward and forward. | |
**/ | |
class Palindrome | |
{ | |
public static function isPalindrome($word) | |
{ | |
$word = trim($word); | |
$word = strtolower($word); |
This file contains hidden or 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 | |
/**As part of a data processing pipeline, complete the implementation of the make_pipeline method: | |
- The method should accept a variable number of functions, and it should return a new function that accepts one parameter $arg. | |
- The returned function should call the first function in the make_pipeline with the parameter $arg, and call the second function with the result of the first function. | |
- The returned function should continue calling each function in the make_pipeline in order, following the same pattern, and return the value from the last function. | |
For example, Pipeline::make_pipeline(function($x) { return $x * 3; }, function($x) { return $x + 1; }, function($x) { return $x / 2; }) then calling the returned function with 3 should return 5. | |
**/ | |
class Pipeline | |
{ | |
public static function make_pipeline() |
This file contains hidden or 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
require 'rubygems' | |
Pry.commands.alias_command 'c', 'continue' | |
Pry.commands.alias_command 's', 'step' | |
Pry.commands.alias_command 'n', 'next' | |
Pry.config.editor = "nvim" | |
def pbcopy(input) | |
str = input.to_s | |
IO.popen('pbcopy', 'w') { |f| f << str } | |
str |
This file contains hidden or 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
browser = Watir::Browser.new(:chrome, headless: true) | |
browser.goto(url) | |
doc = browser.element(css: 'html').wait_until(&:present?) | |
Nokogiri::HTML(doc.inner_html).css('html’) |
OlderNewer