Skip to content

Instantly share code, notes, and snippets.

@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active April 18, 2024 16:58
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@boylea
boylea / livespec.py
Last active April 18, 2024 16:58
pyqtgraph live running spectrogram from microphone
"""
Tested on Linux with python 3.7
Must have portaudio installed (e.g. dnf install portaudio-devel)
pip install pyqtgraph pyaudio PyQt5
"""
import numpy as np
import pyqtgraph as pg
import pyaudio
from PyQt5 import QtCore, QtGui
@sineto
sineto / App.js
Last active April 18, 2024 16:57
User Authentication with Context API and Hooks (useContext, useState)
import React from 'react';
import { BrowserRouter } from 'react-router-dom';
import { UserProvider } from './services/UserContext';
import Routes from './Routes'
function App() {
return (
<BrowserRouter>
@okdimok
okdimok / capture.py
Last active April 18, 2024 16:56
Stream a capture from opencv using VLC
#!/usr/bin/env python
import cv2, sys
cap = cv2.VideoCapture("/dev/video0") # 0 is for /dev/video0
fps = cap.get(cv2.CAP_PROP_FPS)
frame_size = (int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)), int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)))
sys.stderr.write("{}x{} @{}FPS\n".format(frame_size[0], frame_size[1], fps))
while True :
ret, frame = cap.read()
if not ret: break
try:
@P1N2O
P1N2O / README.md
Last active April 18, 2024 16:55
Guide to Compile an Android Kernel with Clang

Android Kernel Compilation Guide

This gist is intended to assist beginners, like myself, in getting started with Android Kernel Compilation. Please note that while I'm sharing my setup and process, this guide may not be entirely accurate, and I welcome suggestions from experienced developers to improve it.

Installing Build Tools

I am on Arch, so I will be using pacman to install the base-devel package group.

sudo pacman -S base-devel

On a Debian based distro, you can use apt and install the build-essential package.

@Justintime50
Justintime50 / ssh-agent-in-crontab.md
Last active April 18, 2024 16:57
Use Your SSH Agent in a Crontab

Use Your SSH Agent in a Crontab

Getting access to SSH inside a Crontab is often a problem for many as the environment in which your cron runs is not the same as your normal shell. Simply running ssh-add will not allow you to use your SSH Agent inside your crontab. Follow the below guide to setup your crontab to use your ssh-agent:

Usage

  1. Install Keychain.
  2. Add the following to your ~/.zlogin file which will be invoked on each login. This will allow your crontab (and normal shell) to use your ssh keys and bypass needing to punch in your password each time you need SSH. This will also span across multiple sessions and shells.
@qoomon
qoomon / conventional_commit_messages.md
Last active April 18, 2024 16:53
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@jeffdonthemic
jeffdonthemic / apex-crud-fls.txt
Last active April 18, 2024 16:52
Simple Apex Controller with CRUD and FLS
This simple controller (without CRUD and FLS) ...
public with sharing class AccountController {
@AuraEnabled
public static List<Account> findAll() {
return [SELECT id, name, Location__Latitude__s, Location__Longitude__s
FROM Account
WHERE Location__Latitude__s != NULL AND Location__Longitude__s != NULL
LIMIT 50];
@Hirrolot
Hirrolot / a-preface.md
Last active April 18, 2024 16:50
A complete implementation of the positive supercompiler from "A Roadmap to Metacomputation by Supercompilation" by Gluck & Sorensen

Supercompilation is a deep program transformation technique due to V. F. Turchin, a prominent computer scientist, cybernetician, physicist, and Soviet dissident. He described the concept as follows [^supercompiler-concept]:

A supercompiler is a program transformer of a certain type. The usual way of thinking about program transformation is in terms of some set of rules which preserve the functional meaning of the program, and a step-by-step application of these rules to the initial program. ... The concept of a supercompiler is a product of cybernetic thinking. A program is seen as a machine. To make sense of it, one must observe its operation. So a supercompiler does not transform the program by steps; it controls and observes (SUPERvises) the running of the machine that is represented by the program; let us call this machine M1. In observing the operation of

@shimo164
shimo164 / drug_arrest.csv
Last active April 18, 2024 16:49
薬物で芸能人が逮捕されたリスト
名前 年月日 曜日 容疑 政治的な批判の対象があったか
尾崎豊 1987-12-22 覚醒剤
今井寿(BUCK-TICK) 1989-04-21
勝新太郎 1990-01-01
ミッキー吉野(ゴダイゴ) 1992-06-01 覚醒剤
江夏豊 1993-03-03 覚醒剤
長渕剛 1995-01-24 大麻
sakura(元L'Arc〜en〜Ciel) 1997-02-24 覚醒剤
翔(横浜銀蝿) 1997-02-27 覚醒剤
槇原敬之 1999-08-26 覚醒剤