Skip to content

Instantly share code, notes, and snippets.

@epetousis
epetousis / compile.sh
Created December 29, 2011 12:31
Tools for loading a kernel panic image into the kernel of OSX
#Instead of building everything manually, you could use this script. Just open Terminal and write chmod 755, press the space bar and then drag this file in.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR"
echo "Compiling load_panic_image.c"
gcc load_panic_image.c -o load_panic_image
echo "Finished compiling load_panic_image.c"
echo "Compiling panic_test.c"
gcc panic_test.c -o panic_test
echo "Finished compiling panic_test.c"
echo "Done! Newly compiled commands can be found at $DIR"
@paulmillr
paulmillr / active.md
Last active April 23, 2024 17:32
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 1000)
@jeremy-w
jeremy-w / nsarray.mm
Created September 24, 2012 19:08
Converting a std::vector into an NSArray
//clang++ -std=c++11 -stdlib=libc++ -framework Foundation nsarray.mm -o nsarray
/* Note:
* - libstdc++ has been frozen by Apple at a pre-C++11 version, so you must opt
for the newer, BSD-licensed libc++
* - Apple clang 4.0 (based on LLVM 3.1svn) does not default to C++11 yet, so
you must explicitly specify this language standard. */
/* @file nsarray.mm
* @author Jeremy W. Sherman
*
* Demonstrates three different approaches to converting a std::vector
@cgarvey
cgarvey / pwd.php
Last active September 22, 2021 09:40
Utility PHP file to use WordPress' password utility to generate a hashed (and salted) version of a typed password. Why? So you can easily generate passwords for use in MySQL scripts / SQL command line, like resetting passwords or adding new users.
<?php
/*
Author
======
Author: Cathal Garvey.
Website: http://cgarvey.ie/
Help/Details Page: http://cgarvey.ie/blog/archive/2013/01/23/manually-generating-salted-hashed-wordpress-passwords/
Copyright
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@mrtj
mrtj / TJIntegerArray.h
Last active July 18, 2018 19:47
Simple Objective C wrapper around a C integer array. Supports fast enumeration via NSNumber objects. #integer #array #objective-c License: BSD
// Author: janos.tolgyesi@gmail.com
// License: BSD
#import <Foundation/Foundation.h>
@interface TJIntegerArray : NSObject <NSFastEnumeration>
{
NSInteger* _array;
}
@tarcieri
tarcieri / semiprivate.md
Last active January 18, 2023 01:08
Ed25519-based semi-private keys

Semiprivate Keys

🚨 DANGER: INSECURE! 🚨

This may have seemed like a great idea in 2013, but the repeated "set/clear bits", a.k.a. clamping phases at each level of the hierarchy slowly subtract key strength.

Don't use this as described. Check out Ristretto.

Original text

Semi-private keys are an expansion of the traditional idea

@dgym
dgym / comic.py
Created May 7, 2013 12:15
A comic like effect using OpenCV
import sys
import numpy
import cv2
def comic(img):
# do edge detection on a grayscale image
gray = cv2.cvtColor(img, cv2.COLOR_BGRA2GRAY)
edges = cv2.blur(gray, (3, 3)) # this blur gets rid of some noise
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@kavu
kavu / example.go
Created September 28, 2013 10:01
Minimal Golang + Cocoa application using CGO. Build with `CC=clang go build`
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
StartApp(void) {
[NSAutoreleasePool new];