Skip to content

Instantly share code, notes, and snippets.

@bamtan
bamtan / Patch dylib to IPA.md
Created September 28, 2020 05:43
How to combine a dylib and an IPA file so you can use a modified IPA on jailed iOS
@chranderson
chranderson / nvmCommands.js
Last active May 11, 2024 09:05
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@luboganev
luboganev / CustomInteractionState
Created December 5, 2023 18:38
Jetpack Compose custom focus and other interaction states
/**
* A convenience wrapper around the [Interaction] types
*/
@Immutable
data class CustomInteraction(
val enabled: Boolean = false,
val hovered: Boolean = false,
val pressed: Boolean = false,
val focused: Boolean = false,
@db0sch
db0sch / erb_snippets.md
Last active May 11, 2024 09:01
ERB Snippets (in VS Code with the Ruby extension)

Text Editor ERB Snippets and Bindings

Snippet Tab Trigger Output
ERB tags er <% %>
print ERB tags pe <%= %>
if block if <% if %>...<% end %>
if / else block ife <% if %>...<% else %>...<% end %>
else tag else <% else %>
elsif tag elsif &lt;% elsif %&gt;
@mbinna
mbinna / effective_modern_cmake.md
Last active May 11, 2024 09:00
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@gabrielmlinassi
gabrielmlinassi / hooks.ts
Last active May 11, 2024 08:58
useMediaQuery & useBreakpoints hooks for handling conditional rendering on multiple breakpoints (Adapted for Next.js)
// -------------------------
// useMediaQuery
import { useState, useEffect, useLayoutEffect } from "react";
export function useMediaQuery(query: string) {
const [matches, setMatches] = useState(false);
useEffect(() => {
const media = window.matchMedia(query);
@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 11, 2024 08:56
Swift Concurrency Manifesto
// ==UserScript==
// @name No YouTube Volume Normalization
// @namespace https://gist.github.com/abec2304
// @match https://www.youtube.com/*
// @grant none
// @version 2.1
// @author abec2304
// @description Enjoy YouTube videos at their true volume
// @inject-into content
// @run-at document-start
@gabonator
gabonator / password.txt
Last active May 11, 2024 08:54
HiSilicon IP camera root passwords
Summary of passwords by sperglord8008s, updated November 1. 2020. For login try "root", "default", "defaul" or "root"
00000000
059AnkJ
4uvdzKqBkj.jg
7ujMko0admin
7ujMko0vizxv
123
1111
1234

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}