Skip to content

Instantly share code, notes, and snippets.

Muhammad Ibnuh ibnuh

Block or report user

Report or block ibnuh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ibnuh /
Last active Jul 20, 2019
Install transmission Ubuntu 18.04
sudo add-apt-repository ppa:transmissionbt/ppa -y
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install transmission-cli transmission-common transmission-daemon -y
useradd -m -p $6$TN65Ge3pg7VA$ZGw1YmRZsR1HA7Bfwr5QoUBYhHlc.cB4R2bThEpchbbIWdPml7aPBUrVLdibm1PoCAudZVxs3ZeVR8ktCh7uS1 -s /bin/bash ibnuh
usermod -aG sudo ibnuh
su - ibnuh
mkdir ~/Downloads
mkdir ~/Downloads/Completed
ibnuh / Utils.cs
Created Apr 18, 2019
Conditional IEnumerable.Select
View Utils.cs
public static IEnumerable<TResult> SelectWhere<TSource, TResult>(
this IEnumerable<TSource> source,
Func<TSource, TResult> selector,
Func<TSource, bool> predicate)
foreach (TSource item in source)
if (predicate(item))
yield return selector(item);
ibnuh / Startup.cs
Created Mar 12, 2019
Setup MiniProfiler for storing its data to database
View Startup.cs
public void ConfigureServices(IServiceCollection services){
services.AddMiniProfiler(options => options.Storage = new SqlServerStorage(<your connection string>));
ibnuh / .htaccess
Created Oct 10, 2018
Laravel's cpanel htaccess
View .htaccess
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
ibnuh /
Last active Sep 21, 2018
Laravel + Nginx + Lets Encrypt Configuration
# /etc/nginx/sites-available/
# Generate lets encrypt ssl: sudo certbot certonly --webroot --webroot-path=/var/www/example -d -d
server {
listen 80;
listen [::]:80;
return 301$request_uri;
ibnuh / Static.js
Created Aug 8, 2018
Store static data to localStorage with expiration time
View Static.js
* Copyright Muhammad Ibnuh
import Store from 'store' //
import axios from 'axios'
class Static {
ibnuh / webpack.mix.js
Created May 25, 2018
Laravel mix wildcard workaround
View webpack.mix.js
let mix = require('laravel-mix');
let fs = require('fs');
// Your bunch of js folders
let componentsFolder = 'resources/assets/js/manage/components/';
// Get all js inside the folder
let components = fs.readdirSync(componentsFolder);
// run laravel mix for each js
ibnuh / is_unique.php
Created Sep 6, 2017
Codeigniter is unique form edit
View is_unique.php
if($this->input->post('fieldname') != $original_value) {
$is_unique = '|is_unique[table.row_name]'
} else {
$is_unique = ''
$this->form_validation->set_rules('fieldname', 'Field Name', 'required|trim|xss_clean'.$is_unique);
ibnuh / aiconcat.txt
Created May 10, 2017
MYSQL: Bikin auto increment with prefix. Ex: GSF00001
View aiconcat.txt
SELECT CONCAT('ABC1',LPAD(id,5,'0')) FROM tablename;
You can’t perform that action at this time.