Skip to content

Instantly share code, notes, and snippets.

View zgunz42's full-sized avatar
๐Ÿ 
Working from home

I Kadek Adi Gunawan zgunz42

๐Ÿ 
Working from home
View GitHub Profile
@NathanBaulch
NathanBaulch / main.go
Last active July 11, 2024 20:27
Optimized solution to APS #038 unique words with unique letters
package main
import (
"bufio"
"fmt"
"io"
"math"
"os"
"runtime"
"sort"
@dstaley41
dstaley41 / BootstrapIcon.svelte
Created April 16, 2020 16:16
Bootstrap Icon w/ Svelte
<script>
/***
* This is super hackish, but way easier than pasting these fkn
* things everywhere in the codebase... run on icons.bootstrap.com in
* console to get new map like so:
function dumpIcons(){
var icons = $$("svg.bi");
var pathMap = {};
icons.forEach((svg) => {
@swdevbali
swdevbali / docker-compose.yml
Created November 23, 2019 01:39
Quick Start Odoo using Docker-Compose
version: '3'
services:
web:
image: odoo:12.0
depends_on:
- db
ports:
- "8069:8069"
volumes:
- odoo-web-data:/var/lib/odoo
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:rxdart/rxdart.dart';
class RiwayatKunjunganBloc {
final riwayatKunjunganAPI = RiwayatKunjunganAPI();
final _dateQuery = BehaviorSubject<DateTime>();
Observable<List<RiwayatKunjunganModel>> _results;
@TomFaulkner
TomFaulkner / gist:9c9f2fd785542947505a3204ddde1e69
Created February 21, 2019 02:36
Docker Compose for home server
version: "3"
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
ports:
- "80:80/tcp"
- "443:443/tcp"
- "192.168.1.21:67:67/udp"
- "192.168.1.21:53:53/udp"
@mihow
mihow / load_dotenv.sh
Last active June 8, 2025 08:29
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
/*Solution for Friends Algorithm written in JavaScript
Painful lessons learned
Javascript keys are always strings
*/
var relationships
var raw_data
//Turn strings into sparse array for search
@mdang
mdang / NOSQL_MONGODB.md
Created August 17, 2016 13:58
Lesson: NoSQL and MongoDB

Intro to NoSQL with Mongo

This lesson is adapted from Jim Clark / Micah Rich's original lesson in the WDI repo

Objectives

  • Describe how Mongo databases came about & why they're useful
  • Compare and contrast NoSQL with SQL
  • Define what a document is in the context of MongoDB
  • Explain the difference between embedded and referenced documents, and how we use each to model relationships in MongoDB
  • Issue basic CRUD commands to a database from the Mongo Shell
@evanwill
evanwill / gitBash_windows.md
Last active June 12, 2025 13:42
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@mingfang
mingfang / convert id_rsa to pem
Last active December 12, 2024 12:13
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 600 id_rsa.pem