Skip to content

Instantly share code, notes, and snippets.

View hoangpq's full-sized avatar
Focusing

Hoang Phan hoangpq

Focusing
View GitHub Profile
@hoangpq
hoangpq / big-o.md
Created November 18, 2021 14:37 — forked from PJUllrich/big-o.md
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for < 32 elements, O(log n) for >= 32 elements [2]
Deletion O(n) for < 32 elements, O(log n) for >= 32 elements
[options]
#
# WARNING:
# If you use the Odoo Database utility to change the master password be aware
# that the formatting of this file WILL be LOST! A copy of this file named
# /etc/odoo/openerp-server.conf.template has been made in case this happens
# Note that the copy does not have any first boot changes
#-----------------------------------------------------------------------------
# Odoo Server Config File - TurnKey Linux
@hoangpq
hoangpq / Profile Rust on Linux.md
Created June 11, 2020 16:21 — forked from KodrAus/Profile Rust on Linux.md
Profiling Rust Applications

Profiling performance

Using perf:

$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg

NOTE: See @GabrielMajeri's comments below about the -g option.

@hoangpq
hoangpq / borrow_vs_as_ref.rs
Created May 10, 2020 14:20 — forked from koute/borrow_vs_as_ref.rs
Rust: Borrow vs AsRef
#![allow(non_snake_case)]
#![allow(dead_code)]
use std::borrow::Borrow;
use std::convert::AsRef;
struct Y;
struct X {
y: Y
@hoangpq
hoangpq / controller.py
Created November 22, 2019 09:34
Odoo Asyncio Example
# -*- coding: utf-8 -*-
from odoo import http
import aiohttp
import asyncio
import time
import json
async def get_json(client, url):
@hoangpq
hoangpq / CMakeLists.txt
Created January 15, 2019 04:40 — forked from squeek502/CMakeLists.txt
Lua 5.3.x Windows CMake build script
project ( lua C )
cmake_minimum_required ( VERSION 2.8 )
include_directories ( src ${CMAKE_CURRENT_BINARY_DIR} )
set ( SRC_CORE src/lapi.c src/lcode.c src/lctype.c src/ldebug.c src/ldo.c src/ldump.c src/lfunc.c src/lgc.c src/llex.c
src/lmem.c src/lobject.c src/lopcodes.c src/lparser.c src/lstate.c src/lstring.c src/ltable.c
src/ltm.c src/lundump.c src/lvm.c src/lzio.c )
set ( SRC_LIB src/lauxlib.c src/lbaselib.c src/lbitlib.c src/lcorolib.c src/ldblib.c src/liolib.c
src/lmathlib.c src/loslib.c src/lstrlib.c src/ltablib.c src/lutf8lib.c src/loadlib.c src/linit.c )
--log_gc (Log heap samples on garbage collection for the hp2ps tool.)
type: bool default: false
--expose_gc (expose gc extension)
type: bool default: false
--max_new_space_size (max size of the new generation (in kBytes))
type: int default: 0
--max_old_space_size (max size of the old generation (in Mbytes))
type: int default: 0
--max_executable_size (max size of executable memory (in Mbytes))
type: int default: 0
// Multiplexed PWM RGB Led Demo
// By Petri Hakkinen
// 24th November 2014
//
// Arduino Uno driving a single RGB led with only one resistor.
//
// Make the following connections:
// * Connect Arduino pins D2,D3,D3 to anodes of a RGB led.
// * Connect cathode of the RGB led to 330 ohm resistor.
// * Connect the other end of the resistor to ground.
@hoangpq
hoangpq / starUML.md
Created December 6, 2018 16:22 — forked from trandaison/starUML.md
Get full version of StarUML

StarUML

Download: StarUML.io

Crack

Source: jorgeancal

After installing StartUML successfully, modify LicenseManagerDomain.js as follow:

/**
@hoangpq
hoangpq / addTwo.wast
Created November 26, 2018 08:44 — forked from kanaka/addTwo.wast
Run wast (WebAssembly) in node
(module
(func $addTwo (param i32 i32) (result i32)
(i32.add
(get_local 0)
(get_local 1)))
(export "addTwo" (func $addTwo)))