Skip to content

Instantly share code, notes, and snippets.

View mk2's full-sized avatar
💭
Internet

Haruka Asakura mk2

💭
Internet
View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active July 7, 2024 19:42
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:

@Moistbobo
Moistbobo / react-native-picker-select+8.0.4.patch
Created January 11, 2022 04:21
react-native-picker-select android togglePicker patch-package
diff --git a/node_modules/react-native-picker-select/src/index.js b/node_modules/react-native-picker-select/src/index.js
index bcbc93e..9908f06 100644
--- a/node_modules/react-native-picker-select/src/index.js
+++ b/node_modules/react-native-picker-select/src/index.js
@@ -9,13 +9,13 @@ export default class RNPickerSelect extends PureComponent {
static propTypes = {
onValueChange: PropTypes.func.isRequired,
items: PropTypes.arrayOf(
- PropTypes.shape({
- label: PropTypes.string.isRequired,
@HereOrCode
HereOrCode / notification.swift
Created November 8, 2021 02:18
Deliver an OSX notification with Swift
// Remember: import UserNotifications
func sendNotification(title: String, body: String = "") {
let content = UNMutableNotificationContent()
content.title = title
if body.count > 0 {
content.body = body
}
import React from "react";
import ReactDOM from "react-dom";
import { ChakraProvider, DarkMode, Button, LightMode } from "@chakra-ui/react";
import type { ApplicationProps } from "../../shell/src/types";
import { CacheProvider } from "@emotion/react";
import createCache from "@emotion/cache";
function Root(props: ApplicationProps) {
return (
<>
@r0b0t3d
r0b0t3d / useCallback.md
Created July 10, 2021 09:06
Use of useCallback and useMemo

1. Use

1.1. in callback

const handlePress = useCallback(() => {
	// handle press
}, [])

Good 👍

<Button onPress={handlePress} />
@simics-ja
simics-ja / karabinerの設定.md
Last active May 2, 2024 13:55
[Niz Atom 66 キーボード設定メモ] めっちゃ分かりにくいのでメモ

基本的にMacにWindowsキーボードとして認識させ,karabinerでうまいこと割り当てて運用する.

Traget Deviceを

  • Niz BT5.0(Nordic): 一度有線接続したことがある場合
  • Unknown(Nordic): 有線接続したことがない場合

として,以下の設定を行う

  • left_command -> left_option
@fxm90
fxm90 / Combine+Pairwise.swift
Last active February 17, 2024 02:09
Extension for a Combine-Publisher that returns the current and previous value.
//
// Combine+Pairwise.swift
//
// Created by Felix Mau on 17.05.21.
// Copyright © 2021 Felix Mau. All rights reserved.
//
import Combine
extension Publisher {
@adrienpoly
adrienpoly / application.html.erb
Last active March 22, 2024 08:14
Capybara / Stimulus test helper to ensure JS is ready when test starts
<!DOCTYPE html>
<html>
<head>
...
</head>
<body data-controller="js">
<%= yield %>
</body>
</html>
@sindresorhus
sindresorhus / esm-package.md
Last active July 23, 2024 10:30
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@Quramy
Quramy / README.md
Last active March 4, 2021 02:45
TS 4.2