This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
import subprocess | |
import secrets | |
import re | |
import requests | |
import base64 | |
import os | |
from pyperclip import copy | |
# Helpers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage="usage: ./$(basename "$0") -s service [-d] [-m] [-c] app_name | |
where: | |
app_name: the name of the app | |
-s service: the service to change | |
-d disables the service (only put this option if you want to disable access) | |
-m sets the microphone as the service | |
-c sets the camera as the service | |
extra help: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let hrStyle: string = ` | |
.underline { | |
height: .25rem; | |
width: 0%; | |
margin: 0; | |
background: black; | |
border: none; | |
transition: .3s ease-in-out; | |
position: relative; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://twitter.com/zneakr/status/1164651753993715712 | |
/* So @zneakr tweeted about this weird behavior and I decided to tinker with his example. In order to optimize, clang | |
assigns fun_ptr to leak_all_my_secrets no matter what. This leads to "I have 9 toes" being printed no matter the | |
result of the if statement. Super weird behavior from clang and I just wanted to make a note of it :) | |
To reproduce this result: | |
clang funkyClang.c -O1 -o funkyClang; ./funkyClang | |
*/ | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <IOKit/IOKitLib.h> | |
#import <IOKit/graphics/IOGraphicsLib.h> | |
// this helped me out a lot <3: https://stackoverflow.com/questions/3239749/programmatically-change-mac-display-brightness | |
int main(int argc, char *argv[]) { | |
io_iterator_t iterator; | |
kern_return_t result = IOServiceGetMatchingServices(kIOMasterPortDefault, IOServiceMatching("IODisplayConnect"), &iterator); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import plistlib | |
import os | |
import sys | |
import getpass | |
# usage: python contact_reaper.py or python3 contact_reaper.py | |
# tested on macOS Mojave (10.14) | |
def get_main_dir_path(): | |
return "/Users/" + getpass.getuser() + "/Library/Application Support/AddressBook/Sources/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bone_coefficient = -1; | |
addition_constant = -1; | |
error_margin = -1; | |
bone_length = -1; | |
bone_coefficients = [[[0 for col in range(2)]for row in range(3)] for x in range(6)] | |
# Femur | |
bone_coefficients[0][0][0] = 2.32 | |
bone_coefficients[0][0][1] = 2.47 | |
bone_coefficients[0][1][0] = 2.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import numbers | |
def findDivisor(num): | |
# 2,3 are the most common divisor for many numbers hence going by divisor of 2,3 can be quicker | |
# if not then by the same number as divisor | |
if num%2 == 0: | |
return 2 | |
elif num%3==0: | |
return 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <termios.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
const char BACKSPACE_KEY = 127; | |
const char RETURN_KEY = 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
USAGE=$'Usage: imessage <number> <text>\nExample: message 9121231234 \"Hello!\"' | |
if [ "$#" -ne "2" ]; then | |
echo "$USAGE" | |
exit 1; | |
fi | |
exec <"$0" || exit; | |
for i in {1..12} # Reads the first x lines of the program | |
do | |
read v |
NewerOlder