Skip to content

Instantly share code, notes, and snippets.

# IDA (disassembler) and Hex-Rays (decompiler) plugin for Apple AMX
#
# WIP research. (This was edited to add more info after someone posted it to
# Hacker News. Click "Revisions" to see full changes.)
#
# Copyright (c) 2020 dougallj
# Based on Python port of VMX intrinsics plugin:
# Copyright (c) 2019 w4kfu - Synacktiv
@SwiftyAlex
SwiftyAlex / squishybuttonthing.swift
Created April 20, 2024 15:20
squishybuttonthing
// Credit to Raffi for the design! https://twitter.com/raffichill/status/1781492309500027206
struct SquishyButtonThing: View {
@State var expanded: Bool = false
var body: some View {
VStack {
Spacer()
VStack {
/* ~/Library/KeyBindings/DefaultKeyBinding.dict
* Created by VerityJ
*/
{
"$\U007F" = "deleteForward:";
/* 'shift - delete' as forward delete - works in Xcode, not in Terminal */
"\UF708" = "deleteForward:";
@pcuenca
pcuenca / openelm-coreml.py
Created April 30, 2024 09:55
Convert OpenELM to Core ML (float32)
import argparse
import numpy as np
import torch
import torch.nn as nn
import coremltools as ct
from transformers import AutoTokenizer, AutoModelForCausalLM
# When using float16, all predicted logits are 0. To be debugged.
compute_precision = ct.precision.FLOAT32
compute_units = ct.ComputeUnit.CPU_ONLY
@jmceleney
jmceleney / xiaomi-enable-mesh-telnet.py
Last active May 6, 2024 13:54
Python3 file that enables netmode4 on a Xiaomi RB01 AX3200 router
import ssl
import socket
# This script simply replays one side of an intercepted conversation between two Xiaomi
# RB01 (International) AX3200 routers negotiating meshing.
# In effect the script poses as a mesh slave, which causes the mesh master to enable netmode4.
# Enabling netmode is needed as one step in unlocking the router and flashing OpenWrt.
# The router should already have been taken through basic set-up before running this script.
# Netmode4 can be confirmed with curl by requesting the following URL, where ${token} is the "stok"
# variable from your admin session:
@basnijholt
basnijholt / cto_line.pine
Created September 18, 2021 08:23
CTO Line indicator for TradingView
//@version=4
study(title="CTO Line", shorttitle="CTO", overlay=true, resolution="")
smma(src, length) =>
smma = 0.0
smma := na(smma[1]) ? sma(src, length) : (smma[1] * (length - 1) + src) / length
smma
v1 = smma(hl2, 15)
m1 = smma(hl2, 19)
m2 = smma(hl2, 25)
v2 = smma(hl2, 29)
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active May 6, 2024 13:53
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@luizomf
luizomf / settings.json
Created October 24, 2022 13:01
Configuração inicial do VS Code
{
"window.zoomLevel": 2,
"workbench.startupEditor": "none",
"explorer.compactFolders": false,
"workbench.iconTheme": "material-icon-theme",
"editor.fontSize": 18,
"workbench.colorTheme": "OM Theme (Default Dracula Italic)",
"code-runner.executorMap": {
"python": "clear ; python -u",
},
@philcampbell-qhr
philcampbell-qhr / cities.txt
Created January 8, 2020 22:51
list of cities/towns in Canada
100 Mile House, British Columbia
108 Mile House, British Columbia
108 Mile Ranch, British Columbia
150 Mile House, British Columbia
Abbey, Saskatchewan
Abbotsford, British Columbia
Aberarder, Ontario
Abercorn, Quebec
Aberdeen, Saskatchewan
Abernethy, Saskatchewan
@BSVArchie
BSVArchie / leaflet.html
Created May 6, 2024 13:47 — forked from afomi/leaflet.html
Simple Leaflet.js Map Example
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
crossorigin=""></script>
<style>
#map { height: 500px; }