Skip to content

Instantly share code, notes, and snippets.

View wuriyanto48's full-sized avatar

wuriyanto wuriyanto48

View GitHub Profile
@wuriyanto48
wuriyanto48 / firebase-messaging-sw.js
Created September 30, 2022 13:32 — forked from loicginoux/firebase-messaging-sw.js
Adding FCM to an html page to receive notifications and sending then via FCM ruby gem. (edit: HTTPS needed!)
// [START initialize_firebase_in_sw]
// Give the service worker access to Firebase Messaging.
// Note that you can only use Firebase Messaging here, other Firebase libraries
// are not available in the service worker.
importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-messaging.js');
// Initialize the Firebase app in the service worker by passing in the
// messagingSenderId.
firebase.initializeApp({
@wuriyanto48
wuriyanto48 / graphite_install.sh
Created June 10, 2022 03:37 — forked from amoslanka/graphite_install.sh
Install StatsD on an Ubuntu box, including creating an upstart service and the option to build a graphite box or configure Librato as a backend.
#
# Assumes an independent box (we'll call this one "graphite")
#
# Stay up to date
sudo apt-get update
sudo apt-get upgrade
# Install git
sudo apt-get install g++ curl libssl-dev -y
@wuriyanto48
wuriyanto48 / README.md
Created December 2, 2021 04:30 — forked from nmarley/README.md
Go / C++ bindings example

Go / C++ bindings example

This is an example of Go code calling to a C++ library with a C wrapper.

Build

go build  # this only ensures it compiles
@wuriyanto48
wuriyanto48 / install-openjdk.txt
Created August 16, 2021 15:47 — forked from douglarek/install-openjdk.txt
How to install openJDK 11 on macOS
$ curl -C - https://download.java.net/java/ga/jdk11/openjdk-11_osx-x64_bin.tar.gz -O openjdk-11_osx-x64_bin.tar.gz
$ tar xf openjdk-11_osx-x64_bin.tar.gz
$ sudo mv jdk-11.jdk /Library/Java/JavaVirtualMachines/
$ java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
@wuriyanto48
wuriyanto48 / curl.md
Created April 16, 2020 08:57 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@wuriyanto48
wuriyanto48 / postgres-cheatsheet.md
Created April 9, 2020 17:06 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@wuriyanto48
wuriyanto48 / sound_recorder.py
Created January 18, 2020 07:57 — forked from mabdrabo/sound_recorder.py
Simple script to record sound from the microphone, dependencies: easy_install pyaudio
import pyaudio
import wave
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
CHUNK = 1024
RECORD_SECONDS = 5
WAVE_OUTPUT_FILENAME = "file.wav"
@wuriyanto48
wuriyanto48 / haproxy.conf
Created May 2, 2019 14:50 — forked from thpham/haproxy.conf
test config haproxy for gRPC loadbalancing
global
tune.ssl.default-dh-param 1024
defaults
timeout connect 10000ms
timeout client 60000ms
timeout server 60000ms
frontend fe_http
mode http
telegraf:
image: telegraf
restart: always
environment:
HOST_PROC: /rootfs/proc
HOST_SYS: /rootfs/sys
HOST_ETC: /rootfs/etc
hostname: localhost
volumes:
- ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
@wuriyanto48
wuriyanto48 / 00 [clojure 高阶函数用法整理].md
Created September 21, 2018 02:43 — forked from BadUncleX/00 [clojure 高阶函数用法整理].md
clojure higher-order functions clj 高阶函数

clojure higher-order functions