Skip to content

Instantly share code, notes, and snippets.

View jimmysawczuk's full-sized avatar

Jimmy Sawczuk jimmysawczuk

View GitHub Profile
@jimmysawczuk
jimmysawczuk / Makefile
Created April 10, 2015 15:52
Makefile variable debug snippet
print-%: ; @echo $*=$($*)
# from http://blog.jgc.org/2015/04/the-one-line-you-should-add-to-every.html
<?php
function array_add(&$arr, array $parts, $val = 1)
{
if (count($parts) > 1)
{
if (!isset($arr[$parts[0]]))
{
$arr[$parts[0]] = [];
}
!function(win, doc, element, url, queue, new_script, invoking_script)
{
// this function is going to attempt to define a queue function we can use to track events. if
// we've defined it once, we're done.
if (win.fbq) return;
// callMethod is defined once we load the Facebook library, but if we get an fbq call before then we'll
// all the arguments onto a queue to be dealt with later.
queue = win.fbq = function()
{
@jimmysawczuk
jimmysawczuk / 00-README.md
Created September 15, 2017 15:32
Close all daily boards

Copy these files into a new directory, then run composer install, then get your API key and token, then run.

@jimmysawczuk
jimmysawczuk / unflatten.go
Last active November 4, 2017 03:45
unflattens a JSON object and makes it whole again
package main
import (
"encoding/json"
"fmt"
"strconv"
"strings"
)
func main() {
/*
* robotMaze.js
*
* The blue key is inside a labyrinth, and extracting
* it will not be easy.
*
* It's a good thing that you're a AI expert, or
* we would have to leave empty-handed.
*/

Keybase proof

I hereby claim:

  • I am jimmysawczuk on github.
  • I am jimmysawczuk (https://keybase.io/jimmysawczuk) on keybase.
  • I have a public key whose fingerprint is 5C2E C85E 5E65 C3BF A08D C84D FE3B 2963 237E 1C3B

To claim this, I am signing this object:

@jimmysawczuk
jimmysawczuk / set-chroot.sh
Created July 5, 2021 23:50 — forked from Tamal/set-chroot.sh
Setting up chroot from a live image in Fedora. Regenerate grub2 for Fedora.
$ # Use Live CD to boot
$ sudo su # Switch to root
$ fdisk -l # Get names of root, boot & EFI partition names. you can also use blkid
$ mount /dev/mapper/fedora_localhost--live-root /mnt # mount root partition
$ cat /mnt/etc/fedora-release
Fedora release 31 (Thirty One)
$ mount /dev/nvme0n1p2 /mnt/boot # mount boot partition
$ mount /dev/nvme0n1p1 /mnt/boot/efi # mount EFI partition
# Note: If you are not able to mount EFI partition ('Input/Output error'),
# You may have to repair ESP file system or format ESP.