Skip to content

Instantly share code, notes, and snippets.

View ilmsg's full-sized avatar
😍
love me love my bug

Eak Netpanya ilmsg

😍
love me love my bug
View GitHub Profile
@etexier
etexier / java-stream-readme.md
Last active March 19, 2025 18:03
Cheat sheet on Java streams

Java Streams

Overview

As part of Java 8 new features, lambda expressions are now supported (Project Lambda). See this very easy-to-read article from Brian Goetz State of the Lambda but more importantly focusing more on streams: State of the Lambda: Libraries Edition

Quick ways to create a stream

// From parameters
@bradtraversy
bradtraversy / docker_wordpress.md
Last active March 9, 2026 13:00
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@shwei
shwei / fastify-in-firebase-function.js
Last active July 4, 2021 07:38
Use fastify in firebase function
'use strict';
const functions = require('firebase-functions');
const fastify = require('./fastify');
exports.greetFromFastify = functions.https.onRequest(fastify);
@bogdanbujdea
bogdanbujdea / screenshot.js
Created September 24, 2018 22:39
Node JS script that uses puppeteer to take a screenshot and save it inside a blob from Azure Storage
var path = require('path');
const puppeteer = require('puppeteer');
var azure = require('azure-storage');
var https = require('https');
function timeout(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
//the chart might take a few seconds to load after the page is ready
@asoorm
asoorm / docker-compose-mongo-replicaset.yml
Created September 14, 2018 19:00
Mongo Replica Set docker compose
version: "3"
services:
mongo1:
hostname: mongo1
container_name: localmongo1
image: mongo:4.0-xenial
expose:
- 27017
ports:
- 27011:27017
const admin = require('firebase-admin')
const { google } = require('googleapis')
const axios = require('axios')
const MESSAGING_SCOPE = 'https://www.googleapis.com/auth/firebase.messaging'
const SCOPES = [MESSAGING_SCOPE]
const serviceAccount = require('./messanging-fbf79-firebase-adminsdk-kag1v-664f36ff55.json')
const databaseURL = 'https://messanging-fbf79.firebaseio.com'
const URL =
@AxelRHD
AxelRHD / go_middleware.go
Last active February 27, 2025 13:48
GO middleware example (with gorilla/mux)
package main
import (
"fmt"
"log"
"net/http"
"github.com/gorilla/context"
"github.com/gorilla/mux"
)
@joshnuss
joshnuss / udp_server.exs
Last active February 5, 2026 18:03
Fault tolerant UDP Server in Elixir
# to run:
# > elixir --no-halt udp_server.exs
# to test:
# > echo "hello world" | nc -u -w0 localhost 2052
# > echo "quit" | nc -u -w0 localhost 2052
# Let's call our module "UDPServer"
defmodule UDPServer do
# Our module is going to use the DSL (Domain Specific Language) for Gen(eric) Servers
use GenServer
@konojunya
konojunya / main.go
Last active November 21, 2022 09:54
Sample using gin's BindJSON
package main
import (
"fmt"
"log"
"github.com/gin-gonic/gin"
)
type CreateParams struct {
@mrcrilly
mrcrilly / gin_jwt_middleware.go
Last active July 3, 2025 09:40
Gin JWT Middleware (Example)
package main
import (
"errors"
"net/http"
"strconv"
"strings"
"time"
"github.com/dgrijalva/jwt-go"