Skip to content

Instantly share code, notes, and snippets.

View GUIEEN's full-sized avatar
💭
美しい未来に

Seung Kwak GUIEEN

💭
美しい未来に
  • tokyo
View GitHub Profile
@stephancasas
stephancasas / sonoma-text-insertion-point-downgrade.jxa.js
Created October 7, 2023 02:58
Disable Sonoma Text Insertion Point ("Cursor" / "Caret")
#!/usr/bin/env osascript -l JavaScript
const App = Application.currentApplication();
App.includeStandardAdditions = true;
const kCFPrefsFeatureFlagsDir = '/Library/Preferences/FeatureFlags/Domain';
const kCFPrefsFeatureEnabledKey = 'Enabled';
const kUIKitDomainPrefsTemporaryPath = '/tmp/UIKit.plist';
const kUIKitRedesignedTextCursorKey = 'redesigned_text_cursor';
@stek29
stek29 / extract_telegram_macos.ipynb
Last active August 29, 2024 11:51
Extract Telegram messages from db_sqlite PostBox – made for Telegram for macOS, but should work with Telegram for iOS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LeZuse
LeZuse / howto.md
Last active July 28, 2024 10:17
Disable Docker for Mac auto-update

Docker downloads all updates into a directory in /Users/$USER/Library/Caches/com.docker.docker/org.sparkle-project.Sparkle Let's make this directory inaccessible to the user under which Docker is going to run (you).

Switch to root user:

  sudo su

Change directory ownership and prevent access to other users:

@koladilip
koladilip / aws-cognito-refresh-tokens-from-brower.js
Last active August 22, 2023 20:13
Code for refreshing AWS Cognito user pool tokens using refresh token from browser.
fetch("https://cognito-idp.<cognito-user-pool-region>.amazonaws.com/", {
headers: {
"X-Amz-Target": "AWSCognitoIdentityProviderService.InitiateAuth",
"Content-Type": "application/x-amz-json-1.1",
},
mode: 'cors',
cache: 'no-cache',
method: 'POST',
body: JSON.stringify({
ClientId: "<cognito-user-pool-client-id>",
@ibraheem4
ibraheem4 / postgres-brew.md
Last active September 13, 2024 11:16 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@dalaidunc
dalaidunc / makedata.js
Last active February 14, 2019 09:28
Create CSV files with dummy data (using node.js)
const fs = require('fs');
const cols = 8;
function randomChar () {
return String.fromCharCode(Math.floor(Math.random() * (122-65) + 65));
}
function randomString (length) {
let string = '';
@dalaidunc
dalaidunc / read.js
Last active January 5, 2019 11:44
2 approaches to reading text files with node.js
const fs = require('fs');
const util = require('util');
const readFile = util.promisify(fs.readFile);
const readdir = util.promisify(fs.readdir);
async function read1 (file) {
const label = `read1-${file}`;
console.time(label);
const data = await readFile(file, 'utf8');
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active August 8, 2024 10:02
React Native Bridging Cheatsheet
@coolaj86
coolaj86 / tcp-http-spy.js
Last active October 16, 2020 07:11
Raw TCP and TLS to HTTP and HTTPS in node.js
'use strict';
var net = require('net');
var http = require('http');
var http80 = http.createServer(function (req, res) {
res.end('Hello, World!');
});
var tcp80 = net.createServer(function (client) {
@coryhouse
coryhouse / ReactBindingApproaches.js
Last active May 4, 2019 18:12
React Binding Approaches
// Approach 1: Use React.createClass
var HelloWorld = React.createClass({
getInitialState() {
return { message: 'Hi' };
},
logMessage() {
// this magically works because React.createClass autobinds.
console.log(this.state.message);
},