Skip to content

Instantly share code, notes, and snippets.

View ManotLuijiu's full-sized avatar
🏠
Working from home

Manot Luijiu ManotLuijiu

🏠
Working from home
View GitHub Profile
@ManotLuijiu
ManotLuijiu / lazada.py
Last active August 5, 2025 01:23
Import Purchase Order from Lazada to ERPNext
import local_config as config
import pandas as pd
import numpy as np
import requests
# ERPNext API credentials
# api_url = config.ERPNEXT_URL_15_ERP + "/api/resource/Sales Invoice" or
api_url = "https://your-erpnext-url/api/resource/Sales%20Invoice"
api_key = config.ERPNEXT_API_KEY_ADMIN_15_ERP
api_secret = config.ERPNEXT_API_SECRET_ADMIN_15_ERP
@ManotLuijiu
ManotLuijiu / thai_zipcode.json
Created April 27, 2023 02:40
All Thai's District Subdistrict and Zip Code
[
{
"zipcode": "พระบรมมหาราชวัง พระนคร กรุงเทพมหานคร 10200"
},
{
"zipcode": "วังบูรพาภิรมย์ พระนคร กรุงเทพมหานคร 10200"
},
{
"zipcode": "วัดราชบพิธ พระนคร กรุงเทพมหานคร 10200"
},
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@alfasin
alfasin / colorful_winston_logger.js
Last active December 19, 2023 01:27
A Nodejs implementation of a console transport logger based on Winston 3.x which also prints the filename and line-number
const winston = require('winston');
const { format } = winston;
const { combine, colorize, timestamp, printf } = format;
/**
* /**
* Use CallSite to extract filename and number, for more info read: https://v8.dev/docs/stack-trace-api#customizing-stack-traces
* @param numberOfLinesToFetch - optional, when we want more than one line back from the stacktrace
* @returns {string|null} filename and line number separated by a colon, if numberOfLinesToFetch > 1 we'll return a string
@ManotLuijiu
ManotLuijiu / fix-git-line-endings
Created October 17, 2018 20:41 — forked from ajdruff/fix-git-line-endings
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
@bradtraversy
bradtraversy / django_deploy.md
Last active December 5, 2025 18:00
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

@bradtraversy
bradtraversy / django_cheat_sheet.md
Last active March 23, 2025 20:59
Django command cheat sheet

Django 2.x Cheat Sheet

Creating a virtual environment

We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder

python -m venv ./venv
@YuriGor
YuriGor / User.test.js
Last active November 16, 2018 03:09
Example of mongoDb test for builderbook
// /test/server/models/User.test.js
// see https://github.com/vladgolubev/jest-mongodb for preparing in-memory mongoDB for this test.
const mongoose = require('mongoose');
const User = require('../../../server/models/User');
describe('slugify', () => {
beforeAll(async () => {
await mongoose.connect(global.__MONGO_URI__);
console.log('connected');

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at [email protected] or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

@ajdruff
ajdruff / fix-git-line-endings
Last active October 13, 2025 19:09
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF