Skip to content

Instantly share code, notes, and snippets.

View nafiesl's full-sized avatar

Nafies Luthfi nafiesl

View GitHub Profile
@nafiesl
nafiesl / how_to_get_telegram_chat_id.md
Created December 20, 2023 11:49
How to get Telegram Bot Chat ID

How to get Telegram Bot Chat ID

Create a Telegram Bot and get a Bot Token

  1. Open Telegram application then search for @BotFather
  2. Click Start
  3. Click Menu -> /newbot or type /newbot and hit Send
  4. Follow the instruction until we get message like so
    Done! Congratulations on your new bot. You will find it at t.me/new_bot.
    
@nafiesl
nafiesl / data.json
Last active May 2, 2023 13:38
Basic File Generator using Bash Script
[
{"name": "website_1", "age": 1},
{"name": "website_2", "age": 2},
{"name": "website_3", "age": 3}
]
@nafiesl
nafiesl / gitignore
Created November 15, 2021 06:25
Wordpress Gitignore
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@nafiesl
nafiesl / .bash_aliases
Last active November 10, 2021 03:57
My .bash_aliases
# Shortcuts
alias hisgrep='history | grep'
alias syslog='sudo tail -f /var/log/kern.log'
alias aliasopen='vim ~/.bash_aliases'
alias editweb='vim routes/web.php'
alias aliassource='source ~/.bash_aliases'
alias hostsopen='sudo vim /etc/hosts'
alias neth='sudo nethogs ppp0'
alias dial='sudo wvdial --config=wvdial.conf'
alias dialg='sudo wvdial --config=gwvdial.conf'
@nafiesl
nafiesl / konsep.md
Created September 17, 2021 03:44
Konsep History Jabatan

Aplikasi History Jabatan

Tentang

Adalah aplikasi untuk mencatat dan melihat history atau riwayat jataban seseorang yang bekerja di suatu instansi/perusahaan.

Tujuan

Membuat suatu aplikasi yang dapat mencatat riwayat jabatan seorang pegawai/karyawan

@nafiesl
nafiesl / backupMySQLDBsinSingleFiles.sh
Created April 25, 2021 22:36
Backup MySQL DB in Single Files
#!/bin/bash
################################################
#
# Backup all MySQL databases in separate files and compress those.
# Furthermore the script will create a folder with the current time stamp
# @author: Per Lasse Baasch (http://skycube.net)
# @Version: 2014-06-13
# NOTE: MySQL and gzip installed on the system
# and you will need write permissions in the directory where you executing this script
#
@nafiesl
nafiesl / codeship-setup-commands-laravel-mysql.txt
Last active February 23, 2021 13:07
Codeship Setup Commands for Laravel that uses MySQL Database
phpenv local 7.0
echo "memory_limit = 512M" >> /home/rof/.phpenv/versions/$(phpenv version-name)/etc/php.ini
# install dependencies
COMPOSER_HOME=${HOME}/cache/composer
composer install --prefer-dist --no-interaction
# set up environment variables
touch .env
echo "APP_ENV=testing" >> .env
echo "APP_DEBUG=true" >> .env
echo "APP_KEY=base64:sQPFP80eWJQGo0SDPc+M2Tib+GLUocRYRw4RLsfM27I=" >> .env
@nafiesl
nafiesl / blade_view.txt
Created January 15, 2020 16:35
Room Schedule
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">Penggunaan Ruangan</h3></div>
<table class="table table-condensed text-center table-hover table-bordered">
<thead>
<th class="text-center col-md-1">{{ __('schedule.session') }}</th>
@foreach(getDays() as $dayId => $day)
<th class="text-center col-md-1">{{ $day }}</th>
@endforeach
</thead>
<tbody>
@nafiesl
nafiesl / sublime-text-keymap
Created December 28, 2019 05:29
Sublime Key Bindings
[
// { "keys": ["ctrl+k", "ctrl+t"], "command": "title_case" },
{ "keys": ["ctrl+shift+g"], "command": "find_all_under" },
{ "keys": ["ctrl+shift+up"], "command": "duplicate_line" },
{ "keys": ["ctrl+shift+down"], "command": "duplicate_line" },
// ctrl+alt+up and ctrl+alt+down are conflicted with window manager keyboard shortcuts
// We need to disable Window Manager -> Keyboard: Upper and Bottom workspace shortcuts
{ "keys": ["ctrl+alt+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["ctrl+alt+down"], "command": "select_lines", "args": {"forward": true} },
{ "keys": ["alt+shift+up"], "command": "swap_line_up" },
@nafiesl
nafiesl / jadwal_pelajaran.md
Last active June 22, 2019 10:51
Jadwal pelajaran

Soal Jadwal Pelajaran

Selamat weekend kawan-kawan.

Kalo ada yang free dan mau iseng-iseng, saya ada sedikit kuis tentang Jadwal Pelajaran

Misalkan kita punya data array hari: