Create or open the file .git/hooks/pre-commit
and paste the following code inside it:
#!/bin/sh
mysqldump \
--no-data \
--dump-date=false \
--result-file=$PWD/dbdump.sql \
--log-error='/dev/null' \
--user='username' \
Create or open the file .git/hooks/pre-commit
and paste the following code inside it:
#!/bin/sh
mysqldump \
--no-data \
--dump-date=false \
--result-file=$PWD/dbdump.sql \
--log-error='/dev/null' \
--user='username' \
Create an app/gear on OpenShift with this cartidge: OpenShift Nginx PHP-FPM Cartridge
Open the file: <your-app-folder>/config/nginx.d/default.conf.erb
, earse all the content, and paste this instead:
server {
root <%= ENV['OPENSHIFT_REPO_DIR'] %>/php;
listen <%= ENV['OPENSHIFT_PHP_IP'] %>:<%= ENV['OPENSHIFT_PHP_PORT'] %>;
server_name <%= ENV['OPENSHIFT_APP_DNS'] %>;
index index.php index.html index.htm;
filter: #{'invert()'} |
<?php | |
function htmlentities_recursive($code) { | |
if (is_array($code)) | |
{ | |
foreach ($code as &$c) $c = htmlentities_recursive($c); | |
return $code; | |
} | |
return htmlentities($code); | |
} |
<?php | |
function caesar_cipher_smart($shift, $input) { | |
$a = str_split('ABCDEFGHIJKLMNOPQRSTUVWXYZ'); | |
$p = str_split($input); | |
foreach ($p as &$v) | |
if (($k = array_search($v, $a)) !== false) { | |
$t = $k+$shift; | |
if ($t < 0) $t = count($a)+$t; | |
$v = $a[$t]; |
Just add this belongsToMany relations to your user model:
/*
* One user follows many users
*/
Run command:
$ bash <(curl -L -s https://goo.gl/eax5A8)
<div ng-app="GoogleMapsMarkerDemo"> | |
<!-- Usage --> | |
<div ng-repeat="marker in ['marker1', 'marker2', 'marker3']"> | |
<google-marker label="$index | indexToAlphabet"></google-marker> | |
</div> | |
<!-- You can have this svg as a separate file --> | |
<script type="text/ng-template" id="google-marker-template"> | |
<svg version="1.1" width="27px" height="43px" viewBox="0 0 27 43" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
/var/cpanel/userdata/username/domain.tld
/var/cpanel/userdata/username/domain.tld_SSL
Change documentroot and scriptalias for cgi-bin
<script> | |
function disableBadInlineCode() { | |
$('style:contains("display: none!important")').each(function (i) { this.disabled = true; }); | |
}; | |
document.addEventListener('DOMContentLoaded', disableBadInlineCode, false); | |
setInterval(disableBadInlineCode, 1000); | |
</script> |