Skip to content

Instantly share code, notes, and snippets.

@imam-san
imam-san / amt.dart
Created February 18, 2020 19:29
Flutter Hex To Ascii
import 'dart:convert';
int covertToAmt(var l){
var amt = 0;
for (int i = 0, j=l.length-1; i < l.length; i++, j--) {
amt+=((l[j]<<(i*8)));
}
return amt;
}
@imam-san
imam-san / BCD Converter.c
Created February 18, 2020 17:08
BCD Converter.c
int Hexascii(unsigned char *dest, unsigned char *src, int size)
{
int i;
if (size > 0)
{
for (i = 0; i < (size / 2); i++)
{
*(dest + (2 *i)) = ((*(src + i) &0xF0) >> 4) + 0x30;
@imam-san
imam-san / gist:f70444c2b25805bd04b40df946894f18
Created March 20, 2018 08:03 — forked from tobym/gist:3538214
My pwdx implementation for a mac
#!/bin/bash
lsof -a -p $1 -d cwd -n | tail -1 | awk '{print $NF}'
@imam-san
imam-san / go-install.md
Created March 14, 2018 17:30 — forked from diegopacheco/go-install.md
How to Install GO Lang on CentOS / Amazon Linux?

How to Install GO Lang on CentOS / Amazon Linux?

sudo wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz
tar -xzf go1.4.2.linux-amd64.tar.gz 
export GOROOT=PATH_WHERE_YOU_EXTRACT_GO
export PATH=$PATH:$GOROOT/bin 
export GOBIN=$GOROOT/bin 
mkdir ~/golang/ 
export GOPATH=~/golang/ 
@imam-san
imam-san / go-install.md
Created March 14, 2018 17:30 — forked from diegopacheco/go-install.md
How to Install GO Lang on CentOS / Amazon Linux?

How to Install GO Lang on CentOS / Amazon Linux?

sudo wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz
tar -xzf go1.4.2.linux-amd64.tar.gz 
export GOROOT=PATH_WHERE_YOU_EXTRACT_GO
export PATH=$PATH:$GOROOT/bin 
export GOBIN=$GOROOT/bin 
mkdir ~/golang/ 
export GOPATH=~/golang/ 
@imam-san
imam-san / postgres-cheatsheet.md
Created January 17, 2018 07:45 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
# redirect output and errors into file output.log:
nohup some_command > output.log 2>&1&
# abbreviated syntax for bash version >= ver.4:
nohup some_command &> output.log
open terminal
defaults write com.apple.finder AppleShowAllFiles YES
@imam-san
imam-san / AmtDefine.java
Last active November 16, 2016 03:15
try amount string to Text in indonesian
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package amounttotext;
/**
*
* @author san
@imam-san
imam-san / git under proxy.txt
Created September 30, 2016 03:15
git under proxy
git config --global http.proxy http://proxyuser:[email protected]:8080
change proxyuser to your proxy user
change proxypwd to your proxy password
change proxy.server.com to the URL of your proxy server
change 8080 to the proxy port configured on your proxy server
If you decide at any time to reset this proxy and work without proxy:
Command to use:
git config --global --unset http.proxy