A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()
):
- Headers
- Links
- Bold
A very basic regex-based Markdown parser. Supports the
following elements (and can be extended via Slimdown::add_rule()
):
- (BOOL)stringContainsEmoji:(NSString *)string { | |
__block BOOL returnValue = NO; | |
[string enumerateSubstringsInRange:NSMakeRange(0, [string length]) options:NSStringEnumerationByComposedCharacterSequences usingBlock: | |
^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) { | |
const unichar hs = [substring characterAtIndex:0]; | |
// surrogate pair | |
if (0xd800 <= hs && hs <= 0xdbff) { | |
if (substring.length > 1) { | |
const unichar ls = [substring characterAtIndex:1]; |
fluidsynth -F output.wav ~/Soundfonts/my-soundfont.sf2 myfile.midi | |
lame output.wav |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'aws-sdk' | |
class S3FolderUpload | |
attr_reader :folder_path, :total_files, :s3_bucket | |
attr_accessor :files |
NSExtensionItem *item = self.extensionContext.inputItems.firstObject; | |
NSItemProvider *itemProvider = item.attachments.firstObject; | |
// Shared plain text is stored here. Content varies wildly based on app. | |
NSString *sharedPlainText = [item.attributedContentText string]; | |
if ([itemProvider hasItemConformingToTypeIdentifier:(NSString *)kUTTypePropertyList]) { | |
[itemProvider loadItemForTypeIdentifier:(NSString *)kUTTypePropertyList | |
options:nil | |
completionHandler:^(NSDictionary *item, NSError *error) { |
#!/bin/bash | |
printf "\e[1;36m\n\ | |
_ _ ____ _ \n\ | |
__ _(_) __| | ___ ___ ___|___ \__ _____| |__ \n\ | |
\ \ / / |/ _\` |/ _ \/ _ \/ __| __) \ \ /\ / / _ \ '_ \ \n\ | |
\ V /| | (_| | __/ (_) \__ \/ __/ \ V V / __/ |_) | \n\ | |
\_/ |_|\__,_|\___|\___/|___/_____| \_/\_/ \___|_.__/ \n\ | |
https://gist.github.com/joshua-barnett/0764f654ba992b663ee9\n\ | |
Usage: \n\ | |
$ ./videos2web.sh input_directory/ output_directory \e[m\\n" |
How to get a Facebook Page Access Token that doesn't expire Never! | |
- Go to http://developers.facebook.com/tools/explorer/ | |
- Get a User Access Token with a permission "manage_pages" | |
- Convert this short-lived access token into a long-lived one by making this Graph API call: | |
https://graph.facebook.com/v2.6/oauth/access_token?client_id=<your FB App ID >&client_secret=<your FB App secret>&grant_type=fb_exchange_token&fb_exchange_token=<your short-lived access token> | |
- Make a call Graph API: | |
https://graph.facebook.com/v2.6/<your personal account FB user id>/accounts?access_token=<your long-lived access token> | |
- The returned access_token has no expiration unless you change your password or not more admin of the target page or deauthorize FB page |
In this quick walkthough you'll learn how to create a separate branch in your repo to house your screenshots and demo gifs for use in your master's readme.
In order to prevent any loss of work it is best to clone the repo in a separate location to complete this task.
Create a new branch in your repo by using git checkout --orphan assets
@implementation AVAudioPCMBuffer (LiveAdditions) | |
- (AVAudioPCMBuffer *)combineWithBuffer:(AVAudioPCMBuffer *)buffer { | |
if (![buffer.format isEqual:self.format]) { | |
return nil; | |
} | |
AVAudioPCMBuffer *combined = [[AVAudioPCMBuffer alloc] initWithPCMFormat:self.format frameCapacity:self.frameCapacity + buffer.frameCapacity]; | |
combined.frameLength = self.frameLength + buffer.frameLength; |