Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View CocoaBeans's full-sized avatar

Kevin Ross CocoaBeans

View GitHub Profile
@CocoaBeans
CocoaBeans / README.md
Created November 14, 2023 20:25 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.
@CocoaBeans
CocoaBeans / gdbinit
Created February 21, 2012 21:58
.gdbinit - A user-friendly gdb configuration file
# INSTALL INSTRUCTIONS: save as ~/.gdbinit
#
# DESCRIPTION: A user-friendly gdb configuration file.
#
# REVISION : 7.3 (16/04/2010)
#
# CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit,
# truthix the cyberpunk, fG!, gln
#
# FEEDBACK: https://www.reverse-engineering.net
@CocoaBeans
CocoaBeans / config.fish
Last active October 27, 2022 21:08
Fish shell custom prompt
########################################################################################
### Fish Custom Overrides
### Creates a shell prompt in the form of:
###
### ----------------------------------------------------------------------- 11:56:05
### kevin@kross /S/L/F/C/V/A/F/L/V/A/Support >
########################################################################################
set --global fish_prompt_username_color 555555
@CocoaBeans
CocoaBeans / 4CF.c
Created July 7, 2016 04:26 — forked from daurnimator/4CF.c
Use your own main loop on OSX
#include <mach/port.h> /* mach_port_t */
#include <mach/mach.h> /* mach_port_allocate(), mach_task_self(), mach_port_insert_member() */
#include <sys/event.h> /* kqueue(), kevent64(), struct kevent64_s, EVFILT_MACHPORT, EV_SET64, EV_ADD */
#include <sys/time.h> /* struct timespec */
//#include <dispatch/private.h>
extern mach_port_t _dispatch_get_main_queue_port_4CF(void);
extern void _dispatch_main_queue_callback_4CF(void);
#include <stdio.h>
#!/bin/bash
SCRIPT_PATH="${0}"
SCRIPT_DIR=`dirname "${SCRIPT_PATH}"`
SCRIPT_DIR=`cd "${SCRIPT_DIR}"; pwd`
echo "$SCRIPT_DIR"
@CocoaBeans
CocoaBeans / .gitignore
Last active December 28, 2015 01:19
Basic .gitignore
# OS X Finder
.DS_Store
# Xcode per-user config
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspectivev3
*.pbxuser
@CocoaBeans
CocoaBeans / StringsLintCheck.sh
Created September 27, 2013 20:46
StringsLintCheck
#!/bin/bash
# for LocalizableStringsIn in $(find "${PROJECT_DIR}"/Languages -name "Localizable.strings.in" -print)
# do
# LocalizableStrings="${LocalizableStringsIn/Localizable.strings.in/Localizable.strings}"
# iconv -f UTF-8 -t UTF-16BE < "${LocalizableStringsIn}" > "${LocalizableStrings}"
# done
# NEEDLE='\( -path "*.lproj/*.strings" \! \( -path "*/build/*" \) \)'
HAYSTACK="${PROJECT_DIR}"
@CocoaBeans
CocoaBeans / OOPinC.c
Last active December 23, 2015 22:59
OOP in C Example
struct {
int (*AND_function_ptr)(int, int);
int (*math_funct_ptr)(float, char, float);
int (*comp_funct_ptr)(double);
int (*regul_funct_ptr)(char*, char*, int);
}functions;
int AND_function (int parameter1, int parameter2)
{
}
@CocoaBeans
CocoaBeans / GetRunningBSDProcesses.m
Created September 8, 2013 18:37
Returns a list of running BSD processes efficiently using sysctl
/* This returns the full process name, rather than the 16 char limit
the p_comm field of the proc struct is limited to.
Note that this only works if the process is running under the same
user you are, or you are running this code as root. If not, then
the p_comm field is used (this function returns nil).
*/
NSString *GetNameForProcessWithPID(pid_t pidNum)
{
NSString *returnString = nil;
@CocoaBeans
CocoaBeans / gist:6074002
Created July 24, 2013 20:01
Quickie for -[NSString stringWithFormat:...] just throw the following in a header.... #define $(...) ((NSString *)[NSString stringWithFormat:__VA_ARGS__,nil]) and then use like [$(@"whatever%ld %@", 2, obj ) stringByRemoving......]
#define $(...) ((NSString *)[NSString stringWithFormat:__VA_ARGS__,nil])
// use like so...[$(@"whatever%ld %@", 2, obj ) stringByRemoving......