Skip to content

Instantly share code, notes, and snippets.

View ibnuh's full-sized avatar
🐵
donkey

Muhammad Ibnuh ibnuh

🐵
donkey
View GitHub Profile
@valeryan
valeryan / WindowsSetup.md
Last active May 4, 2021 09:25
Local WSL Setup

Deprecated in favor of Valet Wiki Page

I set up the wiki page for the valet-wsl project and moved the install guide there. This way it can have user contributions. Please have all disscussions or issues under the valet-wsl project so I can be aware of it. Please go to Valet Wsl Installation Guide

@131digital
131digital / multi-select-dropdown
Created March 29, 2014 17:25
Codeigniter - Populate multi select dropdown from database
<?php
// put in controller
$vendor_categories = $this->vendor_category_model->get_many_by('vendorid',$id);
// get the category the vendor belongs to
$vendorcat = array();
foreach($vendor_categories as $vendor_category => $value){
$vendorcat[$value->categoryid] = $value->categoryid;
}
//data array for view
@saqueib
saqueib / errorHandler.js
Last active June 9, 2022 06:42
Global error handling using axios interceptor for http calls http://www.qcode.in/api-error-handling-in-vue-with-axios
import axios from 'axios'
import toast from './toast'
function errorResponseHandler(error) {
// check for errorHandle config
if( error.config.hasOwnProperty('errorHandle') && error.config.errorHandle === false ) {
return Promise.reject(error);
}
// if has response show the error
@knugie
knugie / mov2mp4.sh
Last active October 6, 2022 14:22
convert .mov to .mp4 using ffmpeg
ffmpeg -i movie.mov -vcodec copy -acodec copy out.mp4
@tpaksu
tpaksu / renew.sh
Created January 19, 2018 07:35
laragon refresh certificates
#!/bin/sh
CRTPATH=$(pwd -W)
for i in *.key ; do
DOMAIN=${i%.key}
cat << EOF > openssl_$DOMAIN.conf
[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no
[req_distinguished_name]
@ian-p-cooke
ian-p-cooke / add_wsl_exclusions.ps1
Last active November 12, 2022 05:02
powershell script to add WSL exclusions
$win_user = "ipc"
$linux_user = "ipc"
$package = "CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc"
$base_path = "C:\Users\" + $win_user + "\AppData\Local\Packages\" + $package + "\LocalState\rootfs"
$dirs = @("\bin", "\sbin", "\usr\bin", "\usr\sbin", "\home\" + $linux_user + "\.cargo\bin")
$dirs | ForEach { Add-MpPreference -ExclusionProcess ($base_path + $_ + "\*") }
Add-MpPreference -ExclusionPath $base_path
@danielhunex
danielhunex / hosted-services-dotnet-core.md
Last active February 21, 2023 20:48
Hosted Services in .Net Core
 
public class HelloContext
{
   private ISomething _smh ; 
     void Foo(string key)
    {
       switch(key)
        {
 case "A":
@adamwathan
adamwathan / promise-take-at-least.js
Last active February 26, 2023 14:25
Promise.takeAtLeast
// Creates a new promise that automatically resolves after some timeout:
Promise.delay = function (time) {
return new Promise((resolve, reject) => {
setTimeout(resolve, time)
})
}
// Throttle this promise to resolve no faster than the specified time:
Promise.prototype.takeAtLeast = function (time) {
return new Promise((resolve, reject) => {
@bnutz
bnutz / 01 pi-hole-vpn-combo_setup.md
Last active May 20, 2023 09:31
Installing Pi-Hole, Unbound and a WireGuard VPN server on a Raspberry Pi (via Docker)

Updated: 2022-07

Raspberry Pi-Hole VPN Setup

I wrote the first edition of this as a guide for myself at the end of 2017 - it was a mashup of Pi-Hole + PiVPN scripts and an IPsec script installed within a separate Raspian Docker image... and it actually worked!

But things have come a long way, and WireGuard happened - I've since streamlined and simplified my setup into a single Docker Compose script.

The steps below assume the following:

@dagelf
dagelf / n.sh
Last active July 17, 2023 02:21 — forked from radu-gheorghe/traffic.sh
Netspeed 2 - gets Linux network interface throughput speed from /proc/net/dev; busybox bash/awk/sed compatible, good for embedded OpenWRT or UBNT / Ubiquiti, etc routers
#!/bin/sh
# Copy the contents of this file to the clipboard, then get a terminal open on your device and enter:
# $ cat > n.sh
# [Ctrl+V] or Right Click, Paste. Then [Ctrl+D].
# chmod +x n.sh
# To run: ./n.sh eth0
SLP=1 # display / sleep interval
DEVICE=$1
IS_GOOD=0
for GOOD_DEVICE in `grep \: /proc/net/dev | awk -F: '{print $1}'`; do