Skip to content

Instantly share code, notes, and snippets.

@PhilipSchmid
PhilipSchmid / minio-upload.sh
Created November 19, 2020 13:38
Upload data to Minio using CURL
#!/bin/bash
# Usage: ./minio-upload my-bucket my-file.zip
bucket=$1
file=$2
host=minio.example.com
s3_key=svc_example_user
s3_secret=svc_example_user_password
@M1chaelTran
M1chaelTran / WebStorm.cmd
Created August 17, 2017 11:04
Add `Open with WebStorm` to Windows right click context menu
@echo off
:: change the path below to match your installed version
SET WebStormPath=C:\Program Files\JetBrains\WebStorm 2017.2.2\bin\webstorm64.exe
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm" /t REG_SZ /v "" /d "Open with WebStorm" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm" /t REG_EXPAND_SZ /v "Icon" /d "%WebStormPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\WebStorm\command" /t REG_SZ /v "" /d "%WebStormPath% \"%%1\"" /f
@commenthol
commenthol / promisify.js
Last active February 26, 2020 13:36
promisify
const promisify = (fn) => (
(...args) => (
new Promise((resolve, reject) => {
fn(...args, (err, ...res) => {
if (err) reject(err)
else resolve(...res)
})
})
)
)
@JamesMGreene
JamesMGreene / .editorconfig
Created November 16, 2015 12:04
Example EditorConfig file
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
@kitek
kitek / gist:1579117
Created January 8, 2012 17:50
NodeJS create md5 hash from string
var data = "do shash'owania";
var crypto = require('crypto');
crypto.createHash('md5').update(data).digest("hex");
@ybogdanov
ybogdanov / node-sync-express-mysql-transactions.js
Created August 30, 2011 15:23
how to use node-sync in express-middleware style with mysql transactions
// Заюзай node-sync v0.1.9beta2, в ней есть .asyncMiddleware()
// это маленькая магия, которая позволяет писать "синхронные" функции типа function(req, res, next)
// еще не знаю, как ее лучше назвать...
app.post('/q/register', function(req, res) {
var mysql = database.spawnConnection();
// А можно реализацию beginSync?
mysql.beginSync();