Skip to content

Instantly share code, notes, and snippets.

View richard457's full-sized avatar
🎯
Focusing

Muragijimana richard457

🎯
Focusing
View GitHub Profile
<?php
// GET
$request = $client->get($url, array('Accept' => 'application/json'));
$response = $request->send();
if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) {
// Error
}
@richard457
richard457 / migration.php
Created March 19, 2019 09:55 — forked from jakzaizzat/migration.php
Update ENUM value in Laravel Migration
DB::statement("ALTER TABLE roles CHANGE COLUMN role role ENUM('system admin', 'super admin', 'admin staff', 'instructor', 'customer', 'gym member', 'swim member')");
@richard457
richard457 / Clean a dirty string
Created March 14, 2019 09:25
Cleaning a string in JavaScript.
let dirtyString= "[Hello world]";
dirtyString.replace(/([^a-z0-9]+)/gi, '');
console.log(dirtyString); // Hello world
@richard457
richard457 / ssh-chroot-jail.sh
Created March 10, 2019 07:30 — forked from floudet/ssh-chroot-jail.sh
Chroot Jail for SSH Access
# Chroot Jail for SSH Access
# Tested on Ubuntu 14.04.2 LTS and Debian GNU/Linux 8 (jessie)
# Reference : http://allanfeid.com/content/creating-chroot-jail-ssh-access
#
# Had to add/change several things to make it work, including:
# - create lib64 folder
# - copy whoami dependencies that ldd doesn't show to fix 'I have no name!'
# in the customized prompt + create passwd file
#