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 | |
class Pipeline | |
{ | |
public static function make_pipeline(...$funcs) | |
{ | |
return function($arg) use ($funcs) | |
{ | |
$x = $arg; |
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 | |
class Palindrome | |
{ | |
public static function isPalindrome($word) | |
{ | |
$toLowercase = strtolower($word); | |
$wordLength = strlen($toLowercase); |
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
ls -lZ | |
setsebool -P httpd_enable_homedirs true | |
chcon -R -t httpd_sys_content_t /var/www/html/ | |
setsebool -P httpd_can_network_connect_db on | |
chcon -R -t httpd_sys_rw_content_t /dir |
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
moment.utc(span.asMilliseconds()).format('HH:mm:ss'); |
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
ALTER TABLE `absensi_rekap` | |
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, | |
CHANGE COLUMN `updated_at` `updated_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; | |
UPDATE absensi_raw SET absensi_timestamp = CONVERT_TZ(absensi_datetime, 'Asia/Jakarta', 'UTC'); | |
UPDATE absensi_raw SET absensi_timestamp = CONVERT_TZ(absensi_datetime, '+07:00', '+00:00'); | |
DELIMITER // | |
CREATE TRIGGER absensi_raw_insert_timestamp | |
BEFORE INSERT |
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
gcloud init | |
export GOOGLE_APPLICATION_CREDENTIALS="/home/secrets.json" | |
functions-emulator start --tail | |
functions-emulator deploy attendances --trigger-http | |
functions-emulator stop |
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
ls -dZ /data/db/ | |
ls -dZ /var/lib/mongo/ | |
chcon -R --reference=/var/lib/mongo /data/db | |
# issues https://github.com/UnderGreen/ansible-role-mongodb/issues/87 |
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
docker ps -f status=exited | grep "\-cache-" | awk '{print $1}' | xargs docker rm |
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
FROM php:7.2.9-fpm | |
WORKDIR /application | |
RUN apt-get update && apt-get upgrade -y | |
RUN apt-get install -y git libpq-dev libldap2-dev libxml2-dev zlib1g-dev libpng-dev libcurl4-gnutls-dev | |
RUN docker-php-ext-configure pgsql --with-pgsql=/usr/local/pgsql \ | |
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ |
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
docker run --rm -it -v $(pwd):/application --workdir=/application composer install | |
docker run --rm -it -v $(pwd):/application --workdir=/application composer create-project francescomalatesta/laravel-api-boilerplate-jwt laravel-api | |
docker run --name mysql5.7 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -p 3306:3306 -d mysql:5.7 | |
docker service create --name mysql -e MYSQL_ALLOW_EMPTY_PASSWORD=yes --publish published=3306,target=3306,protocol=tcp mysql:5.7 | |
docker volume create postgres10.5_data | |
docker run --name postgres10.5 -v postgres10.5_data:/var/lib/postgresql/data -d -p 5432:5432 postgres:10.5 |