Skip to content

Instantly share code, notes, and snippets.

View hohl's full-sized avatar

Michael Hohl hohl

View GitHub Profile
+(NSString *)encryptRSA:(NSString *)plainTextString key:(SecKeyRef)publicKey {
size_t cipherBufferSize = SecKeyGetBlockSize(publicKey);
uint8_t *cipherBuffer = malloc(cipherBufferSize);
uint8_t *nonce = (uint8_t *)[plainTextString UTF8String];
SecKeyEncrypt(publicKey,
kSecPaddingOAEP,
nonce,
strlen( (char*)nonce ),
&cipherBuffer[0],
&cipherBufferSize);
@lukaszgrolik
lukaszgrolik / font-weights.md
Last active April 24, 2024 11:29
Commonly used names for CSS font-weight values

unknown source

value name
100 extralight/ultralight
200 light/thin
300 book/demi/light
400 regular/normal
500 medium
600 semibold/demibold
anonymous
anonymous / content
Created July 15, 2012 17:44
#pragma mark - Info Popover
- (void)showInfoPopover:(id)sender
{
SDPNotificationPopup *controller = [SDPNotificationPopup notificationWithMessage:@"SourceDrop is ready to use!" description:@"Drop a selection or a file on this icon in the menu bar."];
[controller showNotification:sender];
}
@peterhost
peterhost / node_debian_init.sh
Created November 25, 2010 11:41
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28