Skip to content

Instantly share code, notes, and snippets.

@oNguyenNgocTrung
oNguyenNgocTrung / postgres_command.md
Last active May 19, 2024 09:53
Tổng hợp những câu lệnh khi dùng Postgres SQL
@korakot
korakot / record.py
Last active May 12, 2024 01:14
Record audio in Colab using getUserMedia({ audio: true })
# all imports
from IPython.display import Javascript
from google.colab import output
from base64 import b64decode
from io import BytesIO
!pip -q install pydub
from pydub import AudioSegment
RECORD = """
const sleep = time => new Promise(resolve => setTimeout(resolve, time))
@aaronice
aaronice / smart-dark-mode.css
Created January 11, 2018 01:18
CSS for Custom Smart Dark Mode
/*
Parts of this code is inspired from the following:
[1] https://userstyles.org/styles/105000/smart-dark
*/
html {
background-color: #222 !important;
}
body {
@tanaikech
tanaikech / submit.md
Last active May 5, 2024 07:26
Uploading Local Files to Google Drive without Authorization using HTML Form

Uploading Local Files to Google Drive without Authorization using HTML Form

This is a sample script for uploading local file to Google Drive without the authorization using HTML form. A selected file in your local PC using HTML form is uploaded to Google Drive and saved to Google Drive.

When you use this, at first, please deploy Web Apps. The script is doPost() of following scripts.

Script : Google Apps Script

function doPost(e) {
 var data = Utilities.base64Decode(e.parameters.data);
@camman3d
camman3d / svg-to-png.js
Last active April 27, 2024 16:33
Convert SVG to PNG. Verified in Chrome, Safari, and Firefox
// let svg = document.querySelector('svg');
function svgToPng(svg) {
let svgData = new XMLSerializer().serializeToString(svg);
let canvas = document.createElement('canvas');
let ctx = canvas.getContext('2d');
let DOMURL = window.URL || window.webkitURL || window;
let img = new Image();
let blog = new Blob([svgData], {type: 'image/svg+xml'});
let url = DOMURL.createObjectURL(blog);
@meziantou
meziantou / Index.html
Last active April 7, 2024 14:02
Javascript - Record audio
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<h1>Audio</h1>
@sspecht
sspecht / Portable Postgres Install
Last active March 2, 2024 17:26
Portable Postgres / PostGIS Install for Windows
Eine kurze Dokumentation, wie man Postgres/Postgis unter Windows ohne Installation betreibt:
- PG-Binaries (ZIP) herunterladen und entpacken
http://www.enterprisedb.com/products-services-training/pgbindownload
- Batch-Datei lt. Anhang bzw. lt.
http://www.postgresonline.com/journal/archives/172-Starting-PostgreSQL-in-windows-without-install.html
im Haupt-Verzeichnis speichern (das Verzeichnis, in dem /bin zu finden ist).
- Beim ERSTEN Start der run.bat muss die gekennzeichnete Zeile ausgeführt, danach aber wieder auskommentiert werden.