Skip to content

Instantly share code, notes, and snippets.

View anilnatha's full-sized avatar
🎧
001100010010011110100001101101110011

Anil Natha anilnatha

🎧
001100010010011110100001101101110011
  • NASA / Jet Propulsion Laboratory
  • California
View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active September 28, 2024 04:54
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:

@ryancdavison
ryancdavison / iPad-Pro-Magic-Keyboard-Portrait-Mode-DIY-Smart-Connector-Cable.md
Last active September 20, 2024 11:05
iPad Pro 12.9 (2020) Magic Keyboard Portrait Mode DIY Smart Connector Cable

iPad Pro 12.9" (2020) Magic Keyboard Portrait Mode DIY Smart Connector Cable

I wanted my iPad Pro to be able to use the Magic Keyboard in portrait mode, but the current Smart Connector configuration does not allow this. With too much time on my hands, I made a short jumper cable using a section of USB cable, 5-pin POGO connectors (the 5-pin works using pins 1, 3, and 5, and removing pins 2 and 4), a small electrical project box, 3mm N52 magnets, and some epoxy and Sugru to pack everything into place. My cable and connections orientation had more to do with the boxes I found to encase the connector (with holes on the small end) than anything else. Obviously, there will be many ways to do this.

WARNING: Getting any of these steps wrong will probably ruin your iPad.

Note: These measurements are for the 12.9" (2020) model. The magnets did not line up and the polarity was different for my wife's iPad Pro 11" (2021).

![iPad-Pro-MmagicKeyboard-Jumper-Cable-min](https://user-images.githubusercontent.c

@PradyumnaKrishna
PradyumnaKrishna / Commit Date.md
Last active July 15, 2024 20:05
Change Git Commit Date

Change Git Commit Date

  • Commit your git using

    git add -A
    git commit -m "commit message"
    
  • Change time or date of your latest commit

GIT_COMMITTER_DATE="Wed Sep 9 22:00 2020 +0530" git commit --amend --date="Wed Sep 9 22:00 2020 +0530"

@geerlingguy
geerlingguy / pi-cpu-stress.sh
Last active September 18, 2024 17:26
Raspberry Pi CPU temperature and throttling test script
#!/bin/bash
# Raspberry Pi stress CPU temperature measurement script.
#
# Download this script (e.g. with wget) and give it execute permissions (chmod +x).
# Then run it with ./pi-cpu-stress.sh
#
# NOTE: In recent years, I've switched to using s-tui. See:
# https://github.com/amanusk/s-tui?tab=readme-ov-file#options
# Variables.
@esden
esden / led_panel.md
Last active March 23, 2024 12:00
FAQ: Collection of links and information about RGB LED Panels and FPGA

A common name for the interface is HUB75

The displays use shift registers for columns and two sets of row multiplexers.

Typical organization

32x32 panel

  • Organized in two halfs of 16x32 tiles
  • 32 bit long RGB column drive shift registers
  • 4 bit to 16 row drive demultiplexers
def site_authors(request):
return Author.objects.filter(site_id=request.site.id)
class Authorships(Orderable, models.Model):
author = models.ForeignKey('Author', related_name='author_paper_relationship', on_delete=models.CASCADE)
paper = ParentalKey('Page', related_name='paper_author_relationship', on_delete=models.CASCADE)
panels = [
SnippetChooserPanel('author', qs_restriction=site_authors, editable=False)
]
@register_snippet
class Author(models.Model):
first_name = models.CharField(max_length=128)
last_name = models.CharField(max_length=128)
site = models.ForeignKey('wagtailcore.Site', on_delete=models.CASCADE)
panels = [
MultiFieldPanel([
FieldPanel('first_name', classname='col6 first-name'),
FieldPanel('last_name', classname='col6 last-name'),
@MandarGogate
MandarGogate / model.py
Created March 27, 2017 21:19
Limit a single record in model for Django App
class MyModel(models.Model):
onefield = models.CharField('The field', max_length=100)
class MyModelAdmin(admin.ModelAdmin):
def has_add_permission(self, request):
# if there's already an entry, do not allow adding
count = MyModel.objects.all().count()
if count == 0:
return True
return False
@p0bailey
p0bailey / README.md
Last active August 1, 2019 00:01
Terraform Module README

demo terraform module

A terraform module to provide a in AWS/AZURE/ETC,ETC.

This should be used an a generic template to be included in every terraform module.

Module Input Variables

@ericclemmons
ericclemmons / example.md
Last active September 20, 2024 12:46
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here