Skip to content

Instantly share code, notes, and snippets.

View anhdiepmmk's full-sized avatar

PHẠM NGỌC ĐIỆP anhdiepmmk

View GitHub Profile
@anhdiepmmk
anhdiepmmk / phpspreadsheet.php
Created February 22, 2020 04:08
Dùng php spreadsheet đọc file xlsx và hiển thị ra dạng table
<?php
require __DIR__ . '/vendor/autoload.php';
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$spreadsheet = $reader->load("/path/to/your/my.xlsx");
$sheet = $spreadsheet->getSheet(0);
?>
<html>
//will reload
if ('URLSearchParams' in window) {
var searchParams = new URLSearchParams(window.location.search);
searchParams.set("foo", "bar");
window.location.search = searchParams.toString();
}
//without reload
if ('URLSearchParams' in window) {
# description: Description comes here....
# Source function library.
. /etc/init.d/functions
start() {
# code to start app comes here
# example: daemon program_name &
/usr/local/bin/supervisord -c /etc/supervisord.conf
}
@anhdiepmmk
anhdiepmmk / create-swap.sh
Created April 27, 2020 03:17
Cách tạo swap trong linux AMI (EC2 AWS)
#To add this extra space to your instance you type:
sudo /bin/dd if=/dev/zero of=/var/myswap bs=1M count=1024
sudo /sbin/mkswap /var/myswap
sudo chmod 600 /var/myswap
sudo /sbin/swapon /var/myswap
#If you need more than 1024 then change that to something higher.
#To enable it by default after reboot, add this line to /etc/fstab:
#/var/myswap swap swap defaults 0 0
@anhdiepmmk
anhdiepmmk / a.txt
Last active July 31, 2020 05:12
Đoạn script auto translate nho nhỏ viết bằng nodejs và puppeteer
msgid "人間"
msgstr ""
msgid "人"
msgstr ""
msgid "男"
msgstr ""
@anhdiepmmk
anhdiepmmk / gist:57deb492b58dcb54c044bf33fdc47c75
Created August 22, 2020 11:22
Đồ án c# game xếp số
using System;
using System.Collections.Generic;
namespace HL2
{
class Program
{
static int move = 0;
static int currentRowOfZeroValue = 0;
static int currentColumnOfZeroValue = 0;
@anhdiepmmk
anhdiepmmk / Direction.cs
Created August 23, 2020 11:11
Console snake game net core
using System;
namespace HL2
{
public class Direction
{
public static string DIRECTION_RIGHT = "right";
public static string DIRECTION_LEFT = "left";
public static string DIRECTION_UP = "up";
public static string DIRECTION_DOWN = "down";
}
version: "3"
volumes:
kong_data_c: {}
rabbitmq-data: {}
networks:
kong-net:
driver: bridge
package com.example;
public class Main {
public static void main(String[] args) {
MyFrame myFrame = new MyFrame();
myFrame.setVisible(true);
}
}
@anhdiepmmk
anhdiepmmk / pom.xml
Last active September 6, 2020 09:26
an example pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>untitled</artifactId>
<version>1.0-SNAPSHOT</version>