This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[sessionManager | |
setDataTaskWillCacheResponseBlock:^NSCachedURLResponse * | |
(NSURLSession *session, | |
NSURLSessionDataTask *dataTask, | |
NSCachedURLResponse * | |
proposedResponse) { | |
NSURLResponse *response = proposedResponse.response; | |
NSHTTPURLResponse *HTTPResponse = (NSHTTPURLResponse *)response; | |
NSDictionary *headers = HTTPResponse.allHeaderFields; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)isAirPlayActive{ | |
CFDictionaryRef currentRouteDescriptionDictionary = nil; | |
UInt32 dataSize = sizeof(currentRouteDescriptionDictionary); | |
AudioSessionGetProperty(kAudioSessionProperty_AudioRouteDescription, &dataSize, ¤tRouteDescriptionDictionary); | |
if (currentRouteDescriptionDictionary) { | |
CFArrayRef outputs = CFDictionaryGetValue(currentRouteDescriptionDictionary, kAudioSession_AudioRouteKey_Outputs); | |
if(outputs && CFArrayGetCount(outputs) > 0) { | |
CFDictionaryRef currentOutput = CFArrayGetValueAtIndex(outputs, 0); | |
CFStringRef outputType = CFDictionaryGetValue(currentOutput, kAudioSession_AudioRouteKey_Type); | |
return (CFStringCompare(outputType, kAudioSessionOutputRoute_AirPlay, 0) == kCFCompareEqualTo); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Keymap": { | |
"C-p": "peco.SelectPrevious", | |
"C-n": "peco.SelectNext", | |
"Tab": "peco.ToggleSelectionAndSelectNext", | |
"C-r": "peco.RotateMatcher" | |
} | |
} | |
#alias pll='ls | peco | xargs ls -l' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Contributor: Andreas Baumann <abaumann at yahoo dot com> | |
pkgname=snowball-c | |
pkgver=20140401 | |
pkgrel=1 | |
pkgdesc="Snowball rule-based stemming algorithms (shared lib + stemwords executable)" | |
arch=('i686' 'x86_64', 'armv6h') | |
url='http://snowball.tartarus.org/' | |
license=('BSD') | |
makedepends=() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/influxdb/influxdb/client" | |
) | |
func main() { | |
c, err := client.NewClient(&client.ClientConfig{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"math/rand" | |
"net/http" | |
"time" | |
"github.com/influxdb/influxdb/client" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['settings'], | |
function (Settings) { | |
return new Settings({ | |
datasources: { | |
influx: { | |
type: 'influxdb', | |
url: 'http://localhost:8086/db/test', | |
username: 'root', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 { | |
res[i], res[j] = res[j], res[i] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type JSONTime time.Time | |
func (t JSONTime) MarshalJSON() ([]byte, error) { | |
stamp := fmt.Sprintf("\"%d\"", time.Time(t).Unix()) | |
return []byte(stamp), nil | |
} | |
// If you are using gob you need to redefine MarshalBinary | |
func (t JSONTime) MarshalBinary() ([]byte, error) { | |
return time.Time(t).MarshalBinary() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
freebsd-update fetch | |
freebsd-update install | |
portsnap fetch update | |
portmaster -a | |
pkg clean |