Skip to content

Instantly share code, notes, and snippets.

View rayriffy's full-sized avatar
⌨️
Ground pounding keyboard

Phumrapee Limpianchop rayriffy

⌨️
Ground pounding keyboard
View GitHub Profile
@dkun7944
dkun7944 / CDView.swift
Last active October 20, 2024 01:38
SwiftUI + Swift.Shader CD
//
// CDView.swift
// CD
//
// Created by Daniel Kuntz on 7/3/23.
//
import SwiftUI
struct ShapeWithHole: Shape {
@LinusHenze
LinusHenze / iOS_16_Launch_Constraints.txt
Created June 15, 2022 16:30
Description of the Launch Constraints introduced in iOS 16
iOS 16 introduced launch constraints, which can be used to constraint the launch of an application.
There are three types of constraints:
Self Constraints, which the launched application itself must meet
Parent Constraints, which the parent process must meet
Responsible Constraints, which the "responsible process" must meet (I assume that the responsible process is the process that asked launchd to launch a service)
Additionally, the TrustCache format was updated (see below) to support assigning each binary a "Constraint Category", which forces Self and Parent Constraints.
Note that Self, Parent and Responsible Constraints can also be set by the process performing the launch and they can be included in the code signature, in the new blob type 0xFADE8181. In both cases, the constraints are DER encoded (just like the DER entitlements).
Constraint Categories (from TrustCache, new in version 2):
@ZipFile
ZipFile / README.md
Last active November 12, 2024 11:47
Pixiv OAuth Flow

Retrieving Auth Token

  1. Run the command:

    python pixiv_auth.py login

    This will open the browser with Pixiv login page.

<?php
require_once __DIR__ . '/Workerman-master/Autoloader.php';
use Workerman\Worker;
use Workerman\Connection\AsyncTcpConnection;
use Workerman\Protocols\Websocket;
use Workerman\Lib\Timer;
$udp1 = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_set_option($udp1, SOL_SOCKET, SO_BROADCAST, 1);
@revmischa
revmischa / DockerfileLambdaChromium
Created April 1, 2020 18:45
Build chromium on amazon linux 2
FROM lambci/lambda:build-python3.8
# ref: https://chromium.googlesource.com/chromium/src.git/+refs
ARG VERSION
ENV VERSION ${VERSION:-master}
LABEL maintainer="Mischa Spiegelmock <[email protected]>"
LABEL chromium="${VERSION}"
WORKDIR /
@Treeki
Treeki / TurnipPrices.cpp
Last active November 1, 2024 14:15
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@developit
developit / *constant-locals-loader.md
Last active February 4, 2022 17:15
Inline Webpack CSS Modules classNames, reducing bundle size. https://npm.im/constant-locals-loader

constant-locals-loader for Webpack

This loader optimizes the output of mini-css-extract-plugin and/or css-loader, entirely removing the potentially large CSS classname mappings normally inlined into your bundle when using CSS Modules.

Run npm install constant-locals-loader, then make these changes in your Webpack config:

module.exports = {
 module: {
@argyleink
argyleink / is.css
Last active December 9, 2022 20:15
light intro to the :is() selector syntax and value
/* before :is() */
button.focus,
button:focus {
...
}
/* after :is() */
button:is(.focus, :focus) {
...
}
@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active November 10, 2024 14:53
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
@bvaughn
bvaughn / index.md
Last active November 14, 2024 19:13
How to use profiling in production mode for react-dom

React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.

Table of Contents

Profiling in production

React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.