Skip to content

Instantly share code, notes, and snippets.

@josephxanderson
josephxanderson / GDT.asm
Last active March 27, 2022 18:50
Poncho OS Tutorials
[bits 64]
loadGDT:
lgdt [rdi] ; "rdi" register will contain parameter passed to loadGDT when called from C.
; Upload kernelData segment.
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
@josephxanderson
josephxanderson / gist:a5a3e39133052d3a71ed22e9b36a3844
Created February 14, 2018 01:44 — forked from joho/gist:3735740
PostgreSQL 9.2 upgrade steps
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. brew update
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
@josephxanderson
josephxanderson / How to Implement Client Model Observer for Laravel Passport Custom IDs.txt
Last active February 14, 2018 09:14
[See How to Implement.txt below] This Gist shows how to implement a Client model observer for Laravel Passport so that you don't have to be stuck with that weird autoincrementing Client ID.
This Gist provides an example of how to implement a Client Model Observer for Laravel Passport.
This Observer will allow you to intercept the creation of a `Laravel\Passport\Client` model and set a custom id for it.
However, to implement this, you will need to handle the migrations yourself. In my case, the custom ID will be a random, large integer. So the database migrations set the `id` field to a type of `bigInteger`.
Take a look at this complete Gist carefully and implement it yourself. It's very easy.
#Put this in your startup and shutdown scripts.
#Clear nvram null entries
for line in `nvram show | grep =$ `; do var=${line%*=}; nvram unset $var;
done
nvram commit
@josephxanderson
josephxanderson / ipsw.decrypt.md
Created January 10, 2017 16:41 — forked from tzmartin/ipsw.decrypt.md
Decrypting ipsw firmware files
@josephxanderson
josephxanderson / emoji.js
Created September 27, 2016 23:25
For StackExchange Question (At.js and EmojiOne)
$emoji = {
"100": {
"unicode": "1f4af",
"unicode_alternates": "",
"name": "hundred points symbol",
"shortname": ":100:",
"category": "symbols",
"emoji_order": "856",
"aliases": [],
"aliases_ascii": [],
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSessionsTable extends Migration
{
/**
* Run the migrations.
*
<?php
public function devices_index()
{
$sessions = Session::where('user_id', Auth::user()->id)
->get();
dd($sessions); /* Looking through the array, you can see the full ID for each session. */
foreach($sessions as $session)