Skip to content

Instantly share code, notes, and snippets.

View phanmn's full-sized avatar

phanmn

  • Ho Chi Minh city, Viet Nam
View GitHub Profile
@phanmn
phanmn / main.rs
Created April 12, 2024 08:20
Rust Simple Http Server
use std::io::{Read, Write};
use std::net::TcpListener;
fn main() -> std::io::Result<()> {
let listener = TcpListener::bind("127.0.0.1:9000")?;
println!("Listening on port 9000");
for conn in listener.incoming() {
let mut conn = conn?;
@phanmn
phanmn / index.html
Created June 24, 2021 07:23
Electron Capture App Screen
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
<video id="video" autoplay playsinline></video>
@phanmn
phanmn / MarqueeText.vue
Created April 18, 2021 05:21
vue3-marquee-text-component
<script lang="ts">
import { defineComponent, h, useCssModule } from 'vue';
// https://github.com/EvodiaAut/vue-marquee-text-component/blob/master/src/components/MarqueeText.vue
export default defineComponent({
name: 'MarqueeText',
props: {
duration: {
type: Number,
default: 15,
@phanmn
phanmn / machine.js
Last active March 7, 2021 17:20
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@phanmn
phanmn / ripple.styl
Created May 1, 2019 06:10
Vue Ripple Directive
.ripple
position relative
overflow hidden
transform translate3d(0, 0, 0)
.ripple:after
content ''
display block
position absolute
width 100%
@phanmn
phanmn / sipTcpTransport.js
Last active June 8, 2023 18:57
SIP.js TCP Transport Implementation
const SIP = require('sip.js');
const net = require('net');
const TransportStatus = {
STATUS_CONNECTING: 'STATUS_CONNECTING',
STATUS_CONNECTED: 'STATUS_CONNECTED',
STATUS_CLOSING: 'STATUS_CLOSING',
STATUS_CLOSED: 'STATUS_CLOSED'
};
@phanmn
phanmn / how-to-add-route-OpenVPN.md
Created June 13, 2017 01:43
Adding route on client using OpenVPN