-
Make a droplet using LAMP Instance
-
Add a new user (i.e. deployer)
adduser deployer
-
Add the new user to sudo group
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
form[data-drip-embedded-form] { | |
background: #fff url(data:image/gif;base64,R0lGODlhAQADAIABAMzMzP///yH/C1hNUCBEYXRhWE1QPD94cGFja…wbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAABAAMAAAICRFIAOw==) repeat-y center top; | |
font-family: "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif; | |
line-height: 1.5em; | |
overflow: hidden; | |
color: #666; | |
font-size: 16px; | |
border-top: solid 20px #3071b0; | |
border-top-color: #3071b0; | |
border-bottom: solid 10px #3d3d3d; |
In the case where you manually want to decorate a link with the linker parameter, i.e. the link is not a valid anchor link, or the final tracking page is accessed by user in a non direct way: File Download, Extension Installation, ect...
/**
* Returns the Google Analytics tracker linker parameter.
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 | |
$items_per_page = 2; | |
$page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1; | |
$offset = ( $page * $items_per_page ) - $items_per_page; | |
$query = 'SELECT * FROM '.$table_name; | |
$total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table"; | |
$total = $wpdb->get_var( $total_query ); |
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
# To enable CORS you should add lines with CORS rules below to your valet.conf file | |
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx | |
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory | |
# after you edit your valet.conf do not forget to execute `valet restart` | |
server { | |
listen 80 default_server; | |
root /; | |
charset utf-8; | |
client_max_body_size 128M; |
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 | |
// dangerously simple PHP regular expression URL router | |
// requires a mod_rewrite like "RewriteRule . /index.php [L]" | |
function get($url, $callback) { | |
$matches = array(); | |
if (preg_match('~' . $url . '~', $_SERVER['REQUEST_URI'], $matches)) { | |
echo call_user_func_array($callback, $matches); | |
die(); | |
} |
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
(# comment ) | |
(/\*(?:(?!\*/)[\s\S])*\*/) | |
(/\*(?:[^*]|\*[^/])*\*/) | |
(# @keyframes-rule ) | |
(@(?:-webkit-|-moz-)?keyframes(?:[\s\n]|/\*(?:(?!\*/)[\s\S])*\*/)+[a-zA-Z0-9_\-]+(?:[\s\n]|/\*(?:(?!\*/)[\s\S])*\*/)*{(?:[\s\n]|/\*(?:(?!\*/)[\s\S])*\*/)*(?:(?:from|to|[0-9]{1,3}%)(?:[\s\n]|/\*(?:(?!\*/)[\s\S])*\*/)*{(?:[^{}"']|/\*(?:(?!\*/)[\s\S])*\*/|'[^']*'|"[^"]*")*}(?:[\s\n]|/\*(?:(?!\*/)[\s\S])*\*/)*)+(?:[\s\n]|/\*(?:(?!\*/)[\s\S])*\*/)*}) | |
(# ruleset ) | |
((?:[^{}"']|'[^']*'|"[^"]*")+(?:[\s\n]|/\*(?:(?!\*/)[\s\S])*\*/)*{(?:[^{}"']|/\*(?:(?!\*/)[\s\S])*\*/|'[^']*'|"[^"]*")*}) |
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
<? | |
/* works pretty well */ | |
function the_excerpt_max_charlength($id=false, $charlength=55) { | |
global $post; | |
$old_post = $post; | |
if ($id != $post->ID) { | |
$post = get_page($id); | |
} |
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 | |
function route($pattern, $controller) | |
{ | |
return function($query) use($pattern, $controller) { | |
return (($matches = route_match($pattern, $query)) === false) ? | |
false : | |
function($registry) use($matches, $controller) { | |
return $controller($matches, $registry); | |
} | |
; |
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
/* | |
A full list of simple easing equations inspired by GIST from greweb - https://gist.github.com/gre/1650294 | |
Equations source - http://gsgd.co.uk/sandbox/jquery/easing/ | |
*/ | |
{ | |
linear: function(t) { | |
return t | |
}, | |
inQuad: function(t) { |
NewerOlder