Skip to content

Instantly share code, notes, and snippets.

View frullah's full-sized avatar
🎯
Focusing

Fajarullah frullah

🎯
Focusing
View GitHub Profile
@frullah
frullah / match.c
Created June 18, 2017 18:57 — forked from ianmackinnon/match.c
C Regex multiple matches and groups example
# gcc -Wall -o match match.c && ./match
#
#include <stdio.h>
#include <string.h>
#include <regex.h>
@frullah
frullah / how-to-use.md
Last active March 27, 2020 18:19
static file browser-sync
  1. Run browser-sync -w\
  2. Access the file from file query parameter instead of in path
    e.g
    use http://localhost:3000?file=index.css
    instead of http://localhost:3000/index.css
@frullah
frullah / linux_server_setup.sh
Last active March 6, 2022 16:35
My debian/ubuntu linux setup
sudo apt update
sudo apt install -y fzf git kitty-terminfo screen wget xclip zsh
# enable scrolling in screen terminal
echo "termcapinfo xterm* ti@:te@" >> ~/.screenrc
##### Install Oh My ZSH #####
echo Y | sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# install zsh-autosuggestions plugin
@frullah
frullah / webssh2-install.sh
Last active July 6, 2020 11:23
WebSSH2 installation script
#!/bin/bash
function error() {
echo $1
exit 1
}
function deps_check() {
which $1 > /dev/null || error "$1 is required to install WebSSH2"
}
@frullah
frullah / ssh-login-once.md
Last active July 10, 2020 11:52
make SSH login once

install keychain

sudo apt update
sudo apt install -y keychain

add below to shell rc file
you can change from id_rsa to another private key file name

  • bash
@frullah
frullah / install.sh
Last active July 18, 2020 00:40
install edge version Git
version=2.27.0
source_code_path=/tmp/git-${version}
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-${version}.tar.gz -O ${source_code_path}.tar.gz
tar -xzf ${source_code_path}.tar.gz -C /tmp
# install Git dependencies
sudo apt-get install -y dh-autoreconf libcurl4-gnutls-dev libexpat1-dev \
gettext libz-dev libssl-dev
# Install additional required dependencies for docs
@frullah
frullah / Gemfile
Created July 30, 2020 19:02
rails additional setup
group :development, :test do
gem 'guard-rspec', require: false
gem 'rspec-rails', '~> 4.0.1'
end
group :development do
gem 'rubocop', '~> 0.88.0', require: false
gem 'spring-commands-rspec'
gem 'spring-commands-rubocop'
end
@frullah
frullah / .rubocop.yml
Last active August 22, 2020 06:28
rails api additional setup
# version 0.88.0
AllCops:
Exclude:
- 'node_modules/**/*'
- 'vendor/**/*'
- 'bin/*'
- 'db/*_schema.rb'
- 'db/schema.rb'
- 'config/spring.rb'
@frullah
frullah / gist:9d0840a5241cd1cbe20491060de0d206
Created July 30, 2020 19:45
rubocop 0.88.0 fix warning
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: false
Layout/SpaceAroundMethodCallOperator:
Enabled: false
Lint/DeprecatedOpenSSLConstant:
Enabled: false
Lint/DuplicateElsifCondition:
@frullah
frullah / fix.php
Created August 6, 2020 19:22
Code fix for my friends
<?php
if (is_numeric($data1) && is_numeric($data2)) {
return $data1*$data2;
} else {
return 0;
}