Skip to content

Instantly share code, notes, and snippets.

View bagus2x's full-sized avatar
🎯
Focusing

tubagus saifulloh bagus2x

🎯
Focusing
View GitHub Profile
$ sudo snap install --classic heroku
$ git init
$ git add . && git commit -m "...
$ touch Procfile
========================
web: bin/contoh
========================
$ go build -o bin/contoh
$ heroku create contoh
$ git push heroku master:master
@bagus2x
bagus2x / c.psm1
Created September 17, 2020 16:42
golang cross compile di windows
$env:GOOS = "linux"
go build -o bin/server server.go
() => 'Assalamualaikum wr wb :)'
@bagus2x
bagus2x / .bashrc
Last active October 16, 2020 01:56
golang env .bashrc
# config yg lain
export GOPATH=/home/bagus2x/Documents/workspace/go
export GOBIN=/home/bagus2x/Documents/workspace/go/bin
export PATH=$PATH:$GOBIN
export PATH="$PATH:$(yarn global bin)"
alias n=nvim
alias repo="cd ~/Documents/workspace/go/src/github.com/bagus2x"
@bagus2x
bagus2x / ps1.sh
Last active October 29, 2020 06:06
bash shell ps1 example | user[branch]►►
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo "[${BRANCH}${STAT}]"
else
echo ""
@bagus2x
bagus2x / ps1.sh
Created October 29, 2020 06:06
simple ps1
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo "[${BRANCH}${STAT}]"
else
echo ""
fi
class Main {
public static void main(String[] args) {
int nilai[][] = {
{15, 10, 7, 12, 25},
{37, 22, 30, 17, 11},
{8, 37, 4, 18, 32}
};
int max = nilai[0][0];
for(int i = 0; i < nilai[0].length; i++) { // kolom
@bagus2x
bagus2x / goroutineerror.go
Last active December 3, 2020 22:18
belajar handle error di goroutine dengan channel
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
type result struct {
data string
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=[pass]' -p 1433:1433 -d mcr.microsoft.com/mssql/server
docker exec -it [cont_name/id] bash
# Inside container
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P [pass]
[{"codes":"1F600","char":"😀","name":"grinning face","category":"Smileys & Emotion (face-smiling)","group":"Smileys & Emotion","subgroup":"face-smiling"},{"codes":"1F603","char":"😃","name":"grinning face with big eyes","category":"Smileys & Emotion (face-smiling)","group":"Smileys & Emotion","subgroup":"face-smiling"},{"codes":"1F604","char":"😄","name":"grinning face with smiling eyes","category":"Smileys & Emotion (face-smiling)","group":"Smileys & Emotion","subgroup":"face-smiling"},{"codes":"1F601","char":"😁","name":"beaming face with smiling eyes","category":"Smileys & Emotion (face-smiling)","group":"Smileys & Emotion","subgroup":"face-smiling"},{"codes":"1F606","char":"😆","name":"grinning squinting face","category":"Smileys & Emotion (face-smiling)","group":"Smileys & Emotion","subgroup":"face-smiling"},{"codes":"1F605","char":"😅","name":"grinning face with sweat","category":"Smileys & Emotion (face-smiling)","group":"Smileys & Emotion","subgroup":"face-smiling"},{"codes":"1F923","char":"🤣","name":"rolli