Add the following snippet at the bottom of ~/.zshrc
file.
RPROMPT='[%D{%L:%M:%S}] '$RPROMPT
# Base Image | |
FROM php:7.4-fpm-alpine | |
# Update system packages | |
RUN apk update && apk upgrade | |
# Install required pacjages | |
RUN apk add --no-cache nano vim nginx composer supervisor npm git htop \ | |
bzip2-dev zlib-dev libpng icu-dev libxml2-dev \ | |
freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev gettext-dev \ |
javascript: (function() { | |
var newSS, styles = '* { background: #282b2e ! important; color: #e0e2e4 !important } :link, :link * { color: #2868C7 !important } :visited, :visited * { color: #dddddd !important }'; | |
if (document.createStyleSheet) { | |
document.createStyleSheet("javascript:'" + styles + "'"); | |
} else { | |
newSS = document.createElement('link'); | |
newSS.rel = 'stylesheet'; | |
newSS.href = 'data:text/css,' + escape(styles); | |
document.getElementsByTagName("head")[0].appendChild(newSS); | |
} |
{ | |
"shell_cmd": "php-cs-fixer fix --rules=@Symfony,array_indentation --using-cache=false $file", | |
"file_regex": "php$" | |
} |
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
class GoogleSheetController extends Controller | |
{ | |
protected $sheets; |
<?php | |
public function sampleArrayPaginator(Request $request) { | |
$response = array(); | |
$page = ($request->has('page')) ? intval($request->page) : 1; | |
$size = ($request->has('size')) ? intval($request->size) : 10; | |
$collection = collect($response); | |
$total = $collection->count(); | |
return new LengthAwarePaginator( | |
array_values($collection->forPage($page, $size)->toArray()), | |
$collection->count(), |
<?php | |
/** | |
* Tracking package via cURL from www.dawnwing.co.za | |
* | |
* @author Kundan K Singh <[email protected]> | |
*/ | |
define('DOMAIN_REQUEST_URL', 'http://www.dawnwing.co.za/business-tools/online-parcel-tracking/'); | |
include_once 'simple_html_dom.php'; |
#!/bin/bash | |
# Copies certain kinds of known files and directories from a given Jenkins master directory | |
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em. | |
set -ex | |
if [ $# -ne 3 ]; then | |
echo usage: $0 jenkins_home git_repos_url git_repos_name | |
exit 1 | |
fi |
<?php | |
function get_wck_select_by_slug($slug) { | |
global $wpdb; | |
$results = $wpdb->get_results( "select * from $wpdb->postmeta where meta_value = '".$slug."'", ARRAY_A ); | |
$post_id = $results[0]['post_id']; | |
$separator = explode('_', $results[0]['meta_key']); | |
$suffix = isset($separator[1]) ? '_'.$separator[1] : ''; | |
$options = explode(',', get_post_meta($post_id, 'options'.$suffix, true)); | |
$labels = explode(',', get_post_meta($post_id, 'labels'.$suffix, true)); | |
/* initialize var */ |
#!/bin/sh | |
#================================================== | |
# AdAway implementation in shell | |
#================================================== | |
# | |
TMP_WORK_PATH="/tmp/.AdAway" | |
count=0 | |
host_sources="https://hosts-file.net/ad_servers.txt | |
https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext |