Skip to content

Instantly share code, notes, and snippets.

View jblyberg's full-sized avatar
⛩️
Namaste.

John Blyberg jblyberg

⛩️
Namaste.
View GitHub Profile
{"version":1,"resource":"file:///Users/jblyberg/code/workbench/SipTwo/src/lib/helpers/DateTimeHelpers.ts","entries":[{"id":"zvjk.ts","timestamp":1650555266423},{"id":"TZDZ.ts","timestamp":1650555728841}]}
#!/usr/bin/env bash
# ~/.macos — https://mths.be/macos
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
@jblyberg
jblyberg / Plugin.php
Created April 26, 2017 17:59
Updated MoxieManager Laravel authenticator for Laravel 5.3 - 5.4
<?php
// Issue with previous plugin because \Illuminate\Session\Middleware\StartSession has been moved to the
// web middleware group. Session has to be explicitly started.
class MOXMAN_LaravelAuthenticator_Plugin implements MOXMAN_Auth_IAuthenticator
{
public function __construct()
{

Keybase proof

I hereby claim:

  • I am jblyberg on github.
  • I am jblyberg (https://keybase.io/jblyberg) on keybase.
  • I have a public key whose fingerprint is 5B2E 31DB 0752 8BFB 1334 A06B 38A1 052F 9F15 5390

To claim this, I am signing this object:

@jblyberg
jblyberg / index.html
Last active April 3, 2023 01:59
Modal with Script
<div class="container">
<h2>Bootstrap - Modal Testing</h2>
<div class="row text-center">
<h3>The Basic Modal</h3>
<a href="#" class="btn btn-lg btn-success" data-toggle="modal" data-target="#basicModal">Click to open Modal</a>
</div>
</div>
@jblyberg
jblyberg / Plugin.php
Last active February 17, 2017 11:54 — forked from frzsombor/gist:ddd0e11f93885060ef35
Share Laravel 5.1 session and check authentication from Moxiemanager.
<?php
/*
|--------------------------------------------------------------------------
| Sharing Laravel's session and checking authentication
|--------------------------------------------------------------------------
|
| Customized Moxiemanager plugin for use in our Laravel App. We use a custom
| External authentication module, but you get the gist (ha ha) of it.
| Put the Plugin.php file in moxiemanager/plugins/LaravelAuthenticator
@jblyberg
jblyberg / gist:97845a429c81b967f222
Last active November 1, 2015 19:25
Working with Dates for Weekly Calendar
$year = date('Y');
$week_no = date('W');
$week_start = new DateTime();
$week_start->setISODate($year, $week_no);
echo $week_start->format('l jS F (Y-m-d)'); // Monday for the current week
// Gets the week range for given date YYYY-MM-DD
function rangeWeek($datestr) {
@jblyberg
jblyberg / gist:35e68be7fa9ebf1e66ed
Last active January 2, 2020 18:50 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Keyboard repeat
@jblyberg
jblyberg / suid-wrapper.c
Created October 16, 2012 14:29
A very small C wrapper for running shell scripts suid. Pretty dangerous, but handy.
#include <unistd.h>
#include <errno.h>
main( int argc, char ** argv, char ** envp )
{
if( setgid(getegid()) ) perror( "setgid" );
if( setuid(geteuid()) ) perror( "setuid" );
envp = 0; /* blocks IFS attack on non-bash shells */
system( "/path/to/bash/script", argv, envp );
perror( argv[0] );
@jblyberg
jblyberg / gist:3865611
Created October 10, 2012 13:21
Sphinx charset_table
charset_table = 0..9, a..z, _, A..Z->a..z, U+00C0->a, U+00C1->a, U+00C2->a, U+00C3->a, U+00C4->a, U+00C5->a, U+00C7->c, U+00C8->e, U+00C9->e, U+00CA->e, U+00CB->e, U+00CC->i, U+00CD->i, U+00CE->i, U+00CF->i, U+00D1->n, U+00D2->o, U+00D3->o, U+00D4->o, U+00D5->o, U+00D6->o, U+00D8->o, U+00D9->u, U+00DA->u, U+00DB->u, U+00DC->u, U+00DD->y, U+00E0->a, U+00E1->a, U+00E2->a, U+00E3->a, U+00E4->a, U+00E5->a, U+00E7->c, U+00E8->e, U+00E9->e, U+00EA->e, U+00EB->e, U+00EC->i, U+00ED->i, U+00EE->i, U+00EF->i, U+00F1->n, U+00F2->o, U+00F3->o, U+00F4->o, U+00F5->o, U+00F6->o, U+00F8->o, U+00F9->u, U+00FA->u, U+00FB->u, U+00FC->u, U+00FD->y, U+00FF->y, U+0100->a, U+0101->a, U+0102->a, U+0103->a, U+0104->a, U+0105->a, U+0106->c, U+0107->c, U+0108->c, U+0109->c, U+010A->c, U+010B->c, U+010C->c, U+010D->c, U+010E->d, U+010F->d, U+0112->e, U+0113->e, U+0114->e, U+0115->e, U+0116->e, U+0117->e, U+0118->e, U+0119->e, U+011A->e, U+011B->e, U+011C->g, U+011D->g, U+011E->g, U+011F->g, U+0120->g, U+0121->g, U+0122->g, U+0123->g