Skip to content

Instantly share code, notes, and snippets.

@sunflsks
sunflsks / oahd-wrapper.c
Last active January 12, 2024 07:09
convert an x86 bin to an arm through oahd-helper
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
void help(char* curbin) {
fprintf(stderr, "%s x86_bin arm64_output\n", curbin);
}
int main(int argc, char** argv) {
@NoahCardoza
NoahCardoza / getOpenTabs.sh
Last active March 21, 2024 10:16
[OSX] Lists the URLs of all the open tabs in a specified browser.
#!/bin/bash
# args: browser
# example: ./getOpenTabs.sh "Brave Browser"
# credits:
# https://gist.github.com/samyk/65c12468686707b388ec43710430a421
# TODO:
# validate args
# don't open app if not already open
@serg0x
serg0x / material-design-shadows.css
Last active July 7, 2023 13:33
Google material design elevation system shadows as css. Based on https://material.io/design/environment/elevation.html#default-elevations Exported with Sketchapp from the Google material design theme editor plugin "Baseline" theme.
/* Shadow 0dp */
box-shadow: none;
/* Shadow 1dp */
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.20);
/* Shadow 2dp */
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.20);
/* Shadow 3dp */
@plroebuck
plroebuck / svg2icns.bash
Last active January 23, 2024 07:03
Create ICNS file from SVG file (with ImageMagick)
#! /bin/bash
###
### svg2icns.bash
### Create ICNS file from SVG
###
### See also:
### <https://stackoverflow.com/questions/12306223/how-to-manually-create-icns-files-using-iconutil#39678276>
### <https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html>
###
@stek29
stek29 / Google Earth WP.md
Last active April 18, 2021 20:13
Google Earth View wallpapers

Downloads all wallpapers from https://g.co/ev and annotates them with nice and clean link (like g.co/ev/1207)

imageIds.json were taken from imageIds.js from Google Chrome Extension json_to_img.py takes path to imageIds.json as first argument and downloads all images in it annotate.sh annotates $1

also see launcher.sh for example

@swillits
swillits / Keycodes.swift
Last active June 19, 2024 07:53
Swift Keyboard Keycodes
struct Keycode {
// Layout-independent Keys
// eg.These key codes are always the same key on all layouts.
static let returnKey : UInt16 = 0x24
static let enter : UInt16 = 0x4C
static let tab : UInt16 = 0x30
static let space : UInt16 = 0x31
static let delete : UInt16 = 0x33
static let escape : UInt16 = 0x35
@damuellen
damuellen / MiniApp.swift
Last active July 3, 2022 17:43
Minimal Swift App
#!/usr/bin/swift
import AppKit
let application = NSApplication.shared
let fileOpenPanel = NSOpenPanel(), fileSavePanel = NSSavePanel()
let window: NSWindow = { window in
window.setContentSize(NSSize(width:800, height:600))
window.styleMask = [.titled, .closable, .miniaturizable]
@stephenlb
stephenlb / animated-gif.md
Last active October 31, 2020 22:57
DIY How to make your own HD Animated GIF Generator

HD Animated GIF Generator

You can make your own HD animated GIF generator.
Follow along with these commands to get started.

HD Animated GIF Generator

git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg
@eahrold
eahrold / closeapp.py
Created January 14, 2014 18:00
close a running application with python and NSWorkspace
#!/usr/bin/python
from AppKit import NSWorkspace
def closeRunningApplication(bundle_id):
ws = NSWorkspace.sharedWorkspace()
runningApps = ws.runningApplications()
for i in runningApps:
if i.bundleIdentifier() == bundle_id:
i.terminate()