Skip to content

Instantly share code, notes, and snippets.

>>> dict = {}
>>> dict['key_1'] = 100
>>> dict['key_2'] = 200
>>> id(dict)
4488532992
>>> dict['key_3'] = 300
>>> id(dict)
4488532992
>>> a = 100
>>> id(a)
4487734736
>>> a = 101
>>> id(a)
4487734768
>>> my_integer = 100
>>> id(my_integer)
4487734736
>>> my_integer.__class__
<class 'int'>
@LukaHuang
LukaHuang / dnoterc
Created July 27, 2021 12:58
dnoterc
editor: vim
apiEndpoint: http://localhost:3000/api
version: "3"
services:
postgres:
image: postgres:11-alpine
environment:
POSTGRES_USER: dnote
POSTGRES_PASSWORD: dnote
POSTGRES_DB: dnote
volumes:
@LukaHuang
LukaHuang / mysql2-catalina.md
Created May 11, 2021 10:20 — forked from fernandoaleman/mysql2-catalina.md
Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Catalina with MySQL 5.7.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl
@LukaHuang
LukaHuang / LICENSE
Created May 7, 2021 21:23 — forked from sinisterchipmunk/LICENSE
tar, gzip, and untar files using ruby in memory without tempfiles
Copyright (C) 2011 by Colin MacKenzie IV
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@LukaHuang
LukaHuang / _basics.scss
Created January 23, 2021 15:21 — forked from nickcooley/_basics.scss
SASS Sample Files
body {
text-align: center;
> #container {
text-align:left;
margin:0 auto;
width:500px;
}
}
@LukaHuang
LukaHuang / ikhoon.postfixTemplates
Created November 16, 2020 07:42 — forked from ikhoon/ikhoon.postfixTemplates
custom postfix template
## Templates for guava ##
.toList : convert to ImmutableList
java.util.stream.Stream -> $expr$.collect(com.google.common.collect.ImmutableList.toImmutableList())
@LukaHuang
LukaHuang / luka.ruby
Last active March 29, 2021 05:48
luka.postfixTemplates
.ee : expect to equal
ANY expect($expr$).to eq($END$)
.let : let
ANY let($expr$) { $END$ }