Skip to content

Instantly share code, notes, and snippets.

View mosleim's full-sized avatar
🌴
my code on @otoricode

muhammad bukhori muslim mosleim

🌴
my code on @otoricode
View GitHub Profile
@mosleim
mosleim / Readme.md
Last active December 30, 2023 23:36
show color from text with flutter

just create new flutter project, and replace the main.dart.

try to paste in textfield :

   Turquoise Blue (#40E0D0)
   Coral Pink (#FF6F61)
   Sunny Yellow (#FFD700)
Leaf Green (#8F9779)
@mosleim
mosleim / AndroidManifest.xml
Last active March 21, 2023 07:01
Try to request storage permission
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.research_storage">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
<application
android:label="research_storage"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
@mosleim
mosleim / main.dart
Created September 29, 2022 06:34
quaint-dawn-1244
// properti
// behavior
class Person{
String name;
int age;
Person(this.name, this.age);
String getMessage(){
final msg ="$name age is $age";
@mosleim
mosleim / numbering.dart
Created October 15, 2021 09:07
Silly double in dart
class Numbering {
final double d;
Numbering({
required this.d,
});
factory Numbering.fromMap(Map<String, dynamic> map) {
return Numbering(
d: map['d'], // will error on flutter and working on dartpad
);
}
@mosleim
mosleim / addTagsToAll
Created July 24, 2020 16:13
Golang::Addtags entire files, entire struct in a directory
for file in ./*.go; do
gomodifytags -file "${file##*/}" -all -add-tags gorm,json,bson,form,xml -w
done
@mosleim
mosleim / coba_websocket_ke_nats.go
Created February 12, 2020 00:56
coba websocket ke nats
func (h *Handler) dksocket(c *gin.Context) {
token := h.extractClaim(c)
conn, err := wsupgrader.Upgrade(c.Writer, c.Request, nil)
nc, _ := nats.Connect(nats.DefaultURL)
nc.Subscribe(token.UserID, func(m *nats.Msg) {
conn.WriteMessage(1, m.Data) // meneruskan subcribe ke websocket. potensi panic ga??
})
nc.Subscribe("pengumuman", func(m *nats.Msg) {
conn.WriteMessage(1, m.Data) // meneruskan subcribe ke websocket. potensi panic ga??
})
@mosleim
mosleim / installwireguard
Created October 7, 2019 15:37
script buat install wireguard server. gak pake nanya macem-macem. tinggal download gak pake macem2.
#!/bin/bash
# original source: https://github.com/angristan/wireguard-install
# this just for automatic response yes :p
# langsung tancap gas pokoknya om :-D
if [ "$EUID" -ne 0 ]; then
echo "You need to run this script as root"
exit 1
fi
@mosleim
mosleim / autoinstalldocker-vult
Last active September 27, 2019 16:58
Install docker on debian family
#!/bin/sh
apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
apt update
apt install -y docker-ce docker-compose
#login to vult
#if you don't have an account,
@mosleim
mosleim / gist:581bdd5a6b8bf2fd078e2b1bcecebc00
Created December 10, 2017 10:48 — forked from alifrizkip/gist:e18a21de50e86e7f43dc397e73269f87
Catatan CekCok 20170822 - Tentang IM
Langkah - langkah :
1. Beli Domain
2. Install WP + Plugin : jetpack, yoast, wp super cache akismet
3. Tentukan niche atau random
4. Riset keyword : dengan ekstensi moz resit da, jika diatas 20 jangan diambil
5. SEO On Page : keyword ada title,
6. SEO Off Page : Backlink
@mosleim
mosleim / 1100 List Website Iklan Gratis Indonesia Sebagai Backlink
Created December 10, 2017 10:47
1100 List Website Iklan Gratis Indonesia Sebagai Backlink