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
@Mithrandir0x
Mithrandir0x / disable_wifi_hotspot.bat
Last active August 20, 2018 09:30
Two little batch files to create a cozy WiFi hotspot from the laptop Snatched from xda-developers, yet I don't remember the thread. Kudos to the author.
netsh wlan stop hostednetwork
pause
@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: {
@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 <me@mish.dev>"
LABEL chromium="${VERSION}"
WORKDIR /
@naesheim
naesheim / buildWhenAffected.sh
Last active November 28, 2022 20:20
CircleCi - only build features that has changed
##################
### config.yml ###
##################
version: 2
jobs:
build:
docker:
- image: circleci/python:3.6
steps:
@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) {
...
}
<?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);
@subfuzion
subfuzion / http-status-codes.md
Last active September 3, 2023 09:15
General REST API HTTP Status Codes

Reference: RFC 2616 - HTTP Status Code Definitions

General

  • 400 BAD REQUEST: The request was invalid or cannot be otherwise served. An accompanying error message will explain further. For security reasons, requests without authentication are considered invalid and will yield this response.
  • 401 UNAUTHORIZED: The authentication credentials are missing, or if supplied are not valid or not sufficient to access the resource.
  • 403 FORBIDDEN: The request has been refused. See the accompanying message for the specific reason (most likely for exceeding rate limit).
  • 404 NOT FOUND: The URI requested is invalid or the resource requested does not exists.
  • 406 NOT ACCEPTABLE: The request specified an invalid format.
@wuziq
wuziq / encode.sh
Created September 2, 2018 03:16 — forked from mikoim/README.md
YouTube recommended encoding settings on ffmpeg (+ libx264)
#/bin/sh
ffmpeg -i input -c:v libx264 -preset slow -profile:v high -crf 18 -coder 1 -pix_fmt yuv420p -movflags +faststart -g 30 -bf 2 -c:a aac -b:a 384k -profile:a aac_low output
@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):
@dkun7944
dkun7944 / CDView.swift
Last active January 14, 2024 23:45
SwiftUI + Swift.Shader CD
//
// CDView.swift
// CD
//
// Created by Daniel Kuntz on 7/3/23.
//
import SwiftUI
struct ShapeWithHole: Shape {