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
@PJUllrich
PJUllrich / big-o.md
Last active February 13, 2025 23:48
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for <= 32 elements, O(log n) for > 32 elements [2]
Deletion O(n) for <= 32 elements, O(log n) for > 32 elements
@Ice3man543
Ice3man543 / main.go
Created April 8, 2021 19:03
Golang MongoDB connection example
package main
import (
"context"
"time"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"go.mongodb.org/mongo-driver/mongo/readpref"
)
@N3MIS15
N3MIS15 / beacon.py
Last active November 29, 2024 00:07
micropython iBeacon example
import struct
import ubluetooth as bt
from micropython import const
MANUFACTURER_ID = const(0x004C)
DEVICE_TYPE = const(0x02)
DATA_LENGTH = const(0x15)
BR_EDR_NOT_SUPPORTED = const(0x04)
FLAG_BROADCAST = const(0x01)
MANUFACTURER_DATA = const(0xFF)
@m99coder
m99coder / web_crawler.go
Created March 10, 2021 12:44
Mutual exclusion with mutex
package main
import (
"fmt"
"sync"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
<div class="container" *ngIf="userLoggedIn">
.... visible only to authenticated users
<button *ngIf="user.admin">Delete User</button>
</div>
@kevwan
kevwan / dockerfile.md
Last active November 5, 2022 01:26
The simplest way to write Dockerfile!

1. choose a simple linux image

For example alpine, it's only about 5MB.

2. set timezone if necessary

RUN apk add --no-cache tzdata
ENV TZ America/New_York
@przbadu
przbadu / react_on_docker2.md
Created October 29, 2020 04:31
Docker configuration to run react app

Setup docker to run React app

After setting up docker to generate React app without installing node js in https://gist.github.com/przbadu/4a62a5fc5f117cda1ed5dc5409bd4ac1 It was confusing to some of the devs, how to run react app, so I am creating this as second step to the configuration.

Generate required files in your react project

cd my-react-app
touch Dockerfile Dockerfile.dev docker-compose.yml .dockerignore
@smrfeld
smrfeld / .gitlab-ci.yml
Last active August 13, 2021 09:20
GitLab CI for firebase functions
image: node:12.13.0-alpine
before_script:
- npm i -g firebase-tools
test-functions:
stage: test
script:
- cd functions
- npm install
@benoitpetit
benoitpetit / docker-compose.yml
Last active April 12, 2025 07:07
complete Gitlab installation and a runner with docker
version: '4.5'
services:
# GITLAB
gitlab-web:
image: 'gitlab/gitlab-ce:latest'
restart: always
container_name: gitlab-web
hostname: '192.168.0.14'
environment:
@voidnerd
voidnerd / Mail.js
Last active July 17, 2020 03:57
Email Templating Nodejs Helper
const nodemailer = require("nodemailer");
const path = require("path");
const hbs = require("nodemailer-express-handlebars");
const exphbs = require("express-handlebars");
const Handlebars = require("handlebars");
const {
allowInsecurePrototypeAccess,
} = require("@handlebars/allow-prototype-access");
/** Start Mail Helper */