Skip to content

Instantly share code, notes, and snippets.

View phoorichet's full-sized avatar

Lock Phoorichet phoorichet

View GitHub Profile
@jterral
jterral / azure-pipelines__ios__.yaml
Last active July 19, 2024 03:30
Azure Pipelines to build and deploy iOS appplication with AppCenter
#
# Azure Pipelines
trigger:
batch: true
name: $(Build.BuildId)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
variables:
- group: my-group-var
@resistancecanyon
resistancecanyon / multipleImageContentReader.js
Last active May 7, 2024 15:48
Reading Multiple Image Base64 data using Es6 Async/Await in a html:type:file input
// html
// <input type="file" onchange="imagesSelected" multiple accept=".gif,.jpg,.jpeg,.png" />
async function imagesSelected(event) {
let files = [...event.target.files];
let images = await Promise.all(files.map(f=>{return readAsDataURL(f)}));
//all images' base64encoded data will be available as array in images
}
function readAsDataURL(file) {
@schollz
schollz / files.sh
Last active July 30, 2023 00:19
Go upload/recieve files via POST
#! /bin/bash
for n in {1..100}; do
dd if=/dev/urandom of=file$( printf %d "$n" ).bin bs=1 count=$(( RANDOM + 1024 ))
done
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@JoergM
JoergM / prometheus
Created June 13, 2015 07:44
Prometheus init file for RHEL 5 or 6
#!/bin/bash
#
# /etc/rc.d/init.d/prometheus
#
# Prometheus monitoring server
#
# chkconfig: 2345 20 80 Read
# description: Prometheus monitoring server
# processname: prometheus
@2no
2no / app.js
Created March 19, 2012 14:37
LINE Unofficial API test
var LINE = require('./line.js');
var line = new LINE();
var email = 'your email';
var password = 'your password';
line.login(email, password, function(error, result) {
if (error) {
return;
}