Skip to content

Instantly share code, notes, and snippets.

View keefo's full-sized avatar
📺

Xu Lian keefo

📺
View GitHub Profile
@AlanQuatermain
AlanQuatermain / SingletonInitializer.m
Created November 2, 2010 14:45
An implementation of a Singleton accessor routine. Provides a dispatch_once-based version and a plain version for pre-(10.6|4.0) systems, with load-time method swapping to install the dispatch version if libdispatch is available at runtime.
#import <libkern/OSAtomic.h>
#import <dispatch/dispatch.h>
#import <objc/runtime.h>
@implementation MySingleton
+ (void) load
{
// check for weak-linked libdispatch symbols
if ( dispatch_queue_create != 0 )
@MSch
MSch / SingletonInitializer.m
Created April 26, 2011 22:56 — forked from AlanQuatermain/SingletonInitializer.m
An implementation of a Singleton accesAn implementation of a Singleton accessor routine. Removes the (one if-statement) overhead of calling dispatch_once after the first time by method swizzling sharedInstance for a method without dispatch_once
#import <dispatch/dispatch.h>
#import <objc/runtime.h>
@implementation MySingleton
static MySingleton * __singleton = nil;
+ (MySingleton *) sharedInstance_accessor
{
return ( __singleton );
@guymac
guymac / setcover.cpp
Last active July 22, 2021 20:54
Embeds cover art in music files (MP3, M4A/AAC, Ogg/Vorbis)
/*
Command-line application for embedding JPEG cover art in MP3, MP4 and OGG audio files.
Based on taglib-1.7 (debian libtag1-dev)
and libb64 (http://libb64.sourceforge.net/) needed for OGG Vorbis embedded cover art
g++ -I/usr/local/include/taglib -L/usr/local/lib -ltag -lb64 setcover.cpp -o setcover
g++ -I/opt/homebrew/include/taglib -L/opt/homebrew/include/b64 -ltag -lb64 setcover.cpp -o setcover
*/
@keefo
keefo / postweiboviamiao.m
Last active December 20, 2015 14:49
Post Weibo via Miao
if ([[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:@"com.beyondcow.Miao"]) {
//if find Miao on this Mac then post text via Miao system service port
NSString *text = @"Hello world!";
[[NSPasteboard generalPasteboard] clearContents];
[[NSPasteboard generalPasteboard] setString:text forType:NSStringPboardType];
NSPerformService(@"Miao Post Weibo", [NSPasteboard generalPasteboard]);
}
@keefo
keefo / gistclients.markdown
Last active December 30, 2015 19:09
Gist Clients

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

@iwaim
iwaim / serf
Created May 9, 2014 03:04 — forked from zembutsu/serf
#!/bin/sh
#
# chkconfig: - 89 11
# description: serf daemon
# processname: serf
# config: /etc/serf.conf
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Description: serf agent daemon
@namendes
namendes / user.java
Created April 25, 2016 07:13
beyondCow example
final Query query = getQueryManager(context).createQuery(queryString, Query.SQL);
final NodeIterator iter = query.execute().getNodes();
if (iter.hasNext()) {
 user.populate(iter.nextNode());
} else {
 LOG.error("User {} does not exist, returning object without state.", username);
}

11111

  • A
  • B
  1. 1
  2. 2

test

@keefo
keefo / answer.md
Last active May 25, 2021 07:21 — forked from Discord-AppBot/answer.md
AppBot - a Discord bot made for staff application management within Discord.

What are your hobbies?

Table cccssssfds

Syntax Description
Header Title
Paragraph Text
@keefo
keefo / bdd-kep.mkd
Created July 8, 2019 01:19 — forked from hh/bdd-kep.mkd
BDD Markdown KEP