Skip to content

Instantly share code, notes, and snippets.

View twmbx's full-sized avatar
🇿🇲

Twaambo Haamucenje twmbx

🇿🇲
View GitHub Profile
@twmbx
twmbx / routes.php
Created January 4, 2018 10:23 — forked from fhferreira/routes.php
Logout of Auth Basic on Laravel
<?php
Route::get('logout-basic', function() {
return Redirect::to(preg_replace("/:\/\//", "://log-me-out:fake-pwd@", url('/')));
});
@twmbx
twmbx / index.php
Created September 30, 2016 11:15 — forked from drizzentic/index.php
Sample USSD Application
<!-- MIT License
Copyright (c) 2016 Derrick Rono
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@twmbx
twmbx / gist:2423c1a0af34e9646c48
Created March 9, 2016 22:24 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
# commands to ignore
cmdignore=(htop tmux top vim)
# end and compare timer, notify-send if needed
function notifyosd-precmd() {
retval=$?
if [[ ${cmdignore[(r)$cmd_basename]} == $cmd_basename ]]; then
return
else
if [ ! -z "$cmd" ]; then
Event::listen('404', function()
{
$username = URI::segment(1);
$user = User::where_username($username)
->where_type('account')
->first();
if ($user != null) {
if ($user->username != '') {