This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command
$ docker-compose up -d
# To Tear Down
$ docker-compose down --volumes
showProgressDialog(BuildContext context) { | |
showDialog( | |
context: context, | |
barrierDismissible: false, | |
builder: (BuildContext context) { | |
return WillPopScope( | |
onWillPop: () async => false, | |
child: AlertDialog( | |
elevation: 0, |
fun <T> Any.convert(classOfT: Class<T>): T = Gson().fromJson(Gson().toJson(this), classOfT) | |
package org.tillion.aslam.test; | |
class Operations { | |
public static void main(String[] args) { | |
int[] intArr = {5, 4, 3, 8, 9, 11, 3, 3, 2, 9, 8, 7, 1, 22, 15, 67, 4, 17, 54, 67}; | |
for (int j = 0; j < intArr.length - 1; j++) { |
JavaScript, Dart Pattern
^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$
Java, Kotlin Pattern
server { | |
listen 80; | |
listen [::]:80; | |
listen 443 ssl; | |
server_name cdn.lk; | |
ssl_certificate /home/aslam/server/ssl/cdn.lk.crt; | |
ssl_certificate_key /home/aslam/server/ssl/cdn.lk.key; | |
location / { |
import android.content.Context | |
import android.content.res.TypedArray | |
import android.util.AttributeSet | |
import android.view.View | |
import android.widget.LinearLayout | |
import android.widget.TextView | |
class DetailsView @JvmOverloads constructor( | |
context: Context, | |
attrs: AttributeSet? = null, |
import java.util.Date; | |
public class HumanDateUtils { | |
public static String durationFromNow(Date startDate) { | |
long different = System.currentTimeMillis() - startDate.getTime(); | |
long secondsInMilli = 1000; | |
long minutesInMilli = secondsInMilli * 60; |
const express = require("express") | |
const WebSocket = require('ws') | |
const app = express() | |
const server = require('http').createServer(app) | |
const wss = new WebSocket.Server({ noServer: true }) | |
const wschandler = require('./wschandler').from(wss, server) | |
wss.on('connection', (ws, req) => { | |
console.log('connection', req.socket.remoteAddress, ws.data.token) |
#!/bin/bash | |
# This script will move all the files in a directory to a folders | |
# with the name of year and month which it gets from the file's created time. | |
# Run: python categorizer.py /home/aslam/screenshots | |
# It will categorize all of your files by folders as the name of year and month | |
# Ex: 1.jpg will be moved to 2020-10_1 folder as 1.jpg created at 2020-10-15 also | |
# the last number after underscore is the count of the directory | |
import os |