Skip to content

Instantly share code, notes, and snippets.

@iamdylanngo
iamdylanngo / ImageManager.java
Created March 9, 2018 01:55
ImageManager.java
package jundat95.com.cachedata.ultis;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Environment;
import android.util.Log;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
@iamdylanngo
iamdylanngo / SSHTunnel.cs
Created September 25, 2018 02:57
SSHTunnel SSH.NET connect SSH and forward Socks 5
using Renci.SshNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Reflection;
using System.Text;
namespace ToolSSH
{
@iamdylanngo
iamdylanngo / Tutorial.gs
Created September 27, 2018 11:05
Example App Script, Google sheet
// Create or open an existing Sheet and click Tools > Script editor and enter the code below
// 1. Enter sheet name where data is to be written below
var SHEET_NAME = "Sheet1";
// 2. Run > setup
// 3. Publish > Deploy as web app
// - enter Project Version name and click 'Save New Version'
// - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously)
// 4. Copy the 'Current web app URL' and post this in your form/script action
// 5. Insert column names on your destination sheet matching the parameter names of the data you are passing in (exactly matching case)
@iamdylanngo
iamdylanngo / install-php7.2-ubuntu18.04
Last active December 9, 2020 08:51
Install php 7.2 in ubuntu 18.04 lts
// update ubuntu
sudo apt update
// install php 7.2
sudo apt install php7.2-common php7.2-cli php7.2-fpm php7.2-opcache php7.2-gd php7.2-mysql php7.2-curl php7.2-intl php7.2-xsl php7.2-mbstring php7.2-zip php7.2-bcmath php7.2-soap
// check status php7.2
sudo service php7.2-fpm status
@iamdylanngo
iamdylanngo / install-php7.2-ubuntu16.04
Last active December 9, 2020 08:52
install-php7.2-ubuntu16.04
// update ubuntu
sudo apt update
// add PHP repository
sudo apt-get install software-properties-common python-software-properties
or
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
@iamdylanngo
iamdylanngo / remove-php7-on-ubuntu
Last active February 18, 2019 03:47
remove-php7-on-ubuntu
# Remove all php7 in ubuntu
// stop php7.x-fpm service
sudo service php7.2-fpm stop
// remove php7
sudo apt-get remove php7.*
// remvoe all config of php7
sudo apt-get purge php7.*
// remove all dendencies of php7
interface ClockConstructor {
new (hour: number, minute: number): ClockInterface;
}
interface ClockInterface {
tick(): any;
}
function createClock(ctor: ClockConstructor, hour: number, minute: number): ClockInterface {
return new ctor(hour, minute);
@iamdylanngo
iamdylanngo / mixin-typescript-1.ts
Created April 3, 2019 00:43
mixin-typescript-1.ts
function applyMixins(derivedCtor: any, baseCtors: any[]) {
baseCtors.forEach(baseCtor => {
Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
if (name !== 'constructor') {
derivedCtor.prototype[name] = baseCtor.prototype[name];
}
});
});
}
listen.owner = jundat95
listen.group = jundat95
listen.mode = 0660
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1
server {
listen 80;
index index.php;
server_name test.local;
root /var/www/test;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;