Skip to content

Instantly share code, notes, and snippets.

View chardskarth's full-sized avatar
🎯
Focusing

Richard Glen Domingo chardskarth

🎯
Focusing
  • White Cloak Technologies Inc.
  • QC, Metro Manila, Philippines
  • 09:51 (UTC +08:00)
View GitHub Profile
@WebReflection
WebReflection / executable-standalone-module.md
Last active March 4, 2024 20:55
NodeJS Executable Standalone Module

Update

If you're OK in having a node-esm executable, please consider this solution.

#!/usr/bin/env sh
# the /usr/local/bin/node-esm executable
input_file=$1
shift
exec node --input-type=module - $@ <$input_file
@arcezd
arcezd / build.gradle
Created October 2, 2017 16:37
Build Gradle to read yaml properties [Gradle 2.13]
import org.yaml.snakeyaml.DumperOptions
import org.yaml.snakeyaml.Yaml
buildscript{
ext{
springBootVersion = '1.5.7.RELEASE'
}
repositories{
mavenCentral()
}
@stefan-huettemann
stefan-huettemann / RestTemplate-Multipart.java
Last active February 6, 2024 21:19
Multipart Request using spring RestTemplate
protected ResponseEntity<Resource<List<Attachment>>> patchMultipartApiV1_Treatments_TID(final String aTID,
final Treatment aTreatment,
final boolean keepLock,
final MultipartFile... aMultipartFiles) throws IOException {
final MultiValueMap<String, Object> theMultipartRequest = new LinkedMultiValueMap<>();
// creating an HttpEntity for the JSON part:
final HttpHeaders theJsonHeader = new HttpHeaders();
theJsonHeader.setContentType(MediaType.APPLICATION_JSON);
@nesquena
nesquena / PatternEditableBuilder.java
Last active October 21, 2022 10:20
PatternEditableBuilder - Easy way to create colored clickable spans within a TextView!
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.regex.Matcher;