Skip to content

Instantly share code, notes, and snippets.

View tyler-sommer's full-sized avatar
🖖
Working remote

Tyler Sommer tyler-sommer

🖖
Working remote
View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active April 22, 2024 21:28
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
@Fordi
Fordi / console.lineGraph.js
Last active December 29, 2022 23:51
Draw a line graph in Chrome/Chromium's dev console
/**
* Draw a line graph in Chrome/Chromium's dev console
* Examples:
* console.lineGraph([[5, 3], [10, 8], [-10, 1], [7, -3], [3, 0]], 320, 240);
* console.lineGraph(Math.sin, 420, 240, -Math.PI, Math.PI, 0.001);
* console.lineGraph(function (x) {
return [
Math.sqrt(1 - x*x) + Math.abs(x) - 0.75,
(Math.abs(x)-Math.sqrt(1 - x*x)) / 2 - 0.25
];
@NikitaKarnauhov
NikitaKarnauhov / tlrecode.sh
Created May 16, 2016 18:02
Shell script to decode and encode TP-LINK router config files
#!/usr/bin/env bash
# tlrecode.sh
# Decode and encode TP-LINK router config files.
#
# Creative Commons CC0 License:
# http://creativecommons.org/publicdomain/zero/1.0/
#
# To the extent possible under law, the person who associated CC0 with this
# work has waived all copyright and related or neighboring rights to this work.
@skeeto
skeeto / jit.c
Last active September 27, 2023 11:27
Basic JIT
/* http://redd.it/2z68di */
#define _BSD_SOURCE // MAP_ANONYMOUS
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/mman.h>
#define PAGE_SIZE 4096
@amcgregor
amcgregor / _laws.md
Last active February 3, 2022 22:42
Alice's Laws

Alice's Laws

  1. You can only count on yourself.
  2. Never reveal more than you have to.
  3. Execution is nine-tenths of the job.
  4. Give credit where credit is due.
  5. When all else fails, do it yourself.
  6. 90% of a project takes 90% of the time.
  7. The remaining 10% takes an additional 90% of the time.
  8. Never date a co-worker.
@kriswallsmith
kriswallsmith / test.php
Last active December 20, 2015 00:29
A test harness for your Symfony2 project. Runs functional tests in chunks.
#!/usr/bin/env php
<?php
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\ArrayInput as Input;
use Symfony\Component\Console\Input\InputOption as Option;
require_once __DIR__.'/../vendor/autoload.php';
/** Outputs and runs a command. */
@tyler-sommer
tyler-sommer / _area_subnav.html.twig
Created March 21, 2013 23:05
This abuse of the twig templating engine can be used to generate menus given a fairly nice declaration syntax. Currently, it will generate a semi customized bootstrap menu
{% block subnav %}
{# This is how you declare a menu #}
{% include '::subnav.html.twig' with { pages: [
{ name: 'Manage', dropdown: [
{ route: 'customers', name: 'Customers' },
{ route: 'orders', name: 'Orders' },
{ route: 'chargebacks', name:'Chargebacks', role: 'ROLE_ADMIN' }
] },