View script.sh
git fetch -p && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D |
View clinic-staff.json.script
[ | |
{ | |
'repeat(5, 10)': { | |
id: '{{guid()}}', | |
name: '{{firstName()}} {{surname()}}', | |
position: '{{random("Doctor", "Nurse")}}', | |
registered: 'Mon - {{moment(this.date(new Date(2014, 0, 1), new Date())).format("ddd")}} {{random(1,12)}}:00 {{random("am", "pm")}} - {{random(1,12)}}:00 {{random("am", "pm")}}', | |
} | |
} | |
] |
View install-transmission.sh
#!/bin/bash | |
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 |
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); | |
} |
View Startup.cs
public void ConfigureServices(IServiceCollection services){ | |
services.AddMiniProfiler(options => options.Storage = new SqlServerStorage(<your connection string>)); | |
} | |
View .htaccess
<IfModulemod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^(.*)$ public/$1 [L] | |
</IfModule> |
View example.com
# /etc/nginx/sites-available/example.com | |
# Generate lets encrypt ssl: sudo certbot certonly --webroot --webroot-path=/var/www/example -d example.com -d www.example.com | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name example.com www.example.com; | |
return 301 https://example.com$request_uri; | |
} |
View Static.js
/** | |
* Copyright Muhammad Ibnuh | |
* GITHUB: https://github.com/ibnuh | |
* LICENSE: MIT | |
*/ | |
import Store from 'store' // https://www.npmjs.com/package/store | |
import axios from 'axios' | |
class Static { |
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 |
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); |
NewerOlder