Skip to content

Instantly share code, notes, and snippets.

View sambatlim's full-sized avatar
🧮
CODING

Sambat Lim sambatlim

🧮
CODING
View GitHub Profile
@sambatlim
sambatlim / anaconda.md
Last active December 21, 2020 01:49
command to export environment for anaconda

command to export environment for anaconda


conda env export > environment_droplet.yml
@sambatlim
sambatlim / gitcommand.md
Last active April 26, 2021 09:24
useful command to update your forked repository to the original repository you forked from.

commands to update our forked repo to the repo we forked from.

To add upstream repository
git remote add upstream [github repo that your forked from] 
@sambatlim
sambatlim / commune.js
Created August 31, 2020 10:38
cambodian commune information
This file has been truncated, but you can view the full file.
const communes =
[
{
"id": "010201",
"administrative_unit": {
"name_km": "ឃុំ",
"name_latin": "Khum",
"name_en": "Commune"
},
"name_km": "បន្ទាយនាង",
@sambatlim
sambatlim / district.js
Created August 31, 2020 10:37
cambodian district information
const districts =
[
{
"id": "0102",
"administrative_unit": {
"name_km": "ស្រុក",
"name_latin": "Srok",
"name_en": "District"
},
"name_km": "មង្គលបូរី",
@sambatlim
sambatlim / province.js
Created August 31, 2020 10:34
cambodian province information
const provinces =
[
{
"id": "01",
"administrative_unit": {
"name_km": "ខេត្ត",
"name_latin": "Khaet",
"name_en": "Province"
},
"name_km": "បន្ទាយមានជ័យ",
@sambatlim
sambatlim / closure.js
Created August 27, 2020 09:52
simple javascript closure code
/// closure in javascript
// using parentheses
{
const value = 0
}
//console.log(value);
@sambatlim
sambatlim / virtualenv.md
Last active June 25, 2023 16:53
This is the snippet command to create virtual environment and install the requirement.txt in python [For windows].

*Requirement

If you never install virtual environment before, you need to have virtual env install.

py -m pip install --user virtualenv

Get started

$ cd <# your project folder name #>
$ py -m venv env &lt;# (it will create the new folder in your repository called env). #&gt;
var utility = ['pink bag','pink book','pink pen','pink shirt','pink shoe'];
var shop = [{'shopname':'aa shop','sell':'pink bag','price':30000,'distance':2},{'shopname':'bb shop','sell':'pink shirt','price':10000,'distance':3},{'shopname':'cc shop','sell':'pink shoe','price':15000,'distance':1},{'shopname':'dd shop','sell':'pink skirt','price':25000,'distance':0.5}]
var how ={'grab':5000,'own motor':2000};
var moneyihave = 50000;
var findperfectgift = async(moneyihave)=>{
findshop(moneyihave,(whatshop,whattobuy,moneyileft)=>{
findhow(moneyileft,(moneytopay,howigo)=>{
@sambatlim
sambatlim / odoomodule.py
Last active October 28, 2019 02:51
script to generate odoo module command. [LIVE DEMO](https://repl.it/@sambatlim/InfantileWoodenAmoebas)
print("Please, give your module name")
x = input()
print("insert 1 to use default directory, 2 to use your custom addon directory")
y = input()
if int(y) == 1:
print("Command to create the module. * Copy and paste in cmd - run cmd as administration")
directory = r"C:\Users\User\Desktop\custom_addons"
command = "\"C:\Program Files (x86)\Odoo 12.0\python\python.exe\""+" \"C:\Program Files (x86)\Odoo 12.0\server\odoo-bin\""+ " scaffold " + x
print(command + f' "{directory}"')
else: