Skip to content

Instantly share code, notes, and snippets.

View fabriziomoscon's full-sized avatar

Fabrizio Moscon fabriziomoscon

View GitHub Profile
default 18:23:20.166862+0000 apsd Created power assertion {identifier: APSCourier(tcpStream:dataReceived:)}
default 18:23:20.171231+0000 apsd <private>: Outstanding data received: <private> (length 1134) onInterface: NonCellular. Connected on 1 interfaces.
default 18:23:20.171931+0000 apsd <private>: Stream processing: complete yes, invalid no, length parsed 1130, parameters <private>
default 18:23:20.172518+0000 apsd Created power assertion {identifier: APSCourier(tcpStream:dataReceived:)}
default 18:23:20.175354+0000 apsd copyTokenForDomain sandbox.push.apple.com (null)
default 18:23:20.177309+0000 mediaserverd <<<< TimeSyncClock >>>> figTimeSyncClock_Monitor: nowMonClock: 35930.610595; lastMonClock: 35920.639408; nowMonNet: 35930.611 (0xa55e608d88c30000); lastMonNet: 35920.639 (0xa55e608d88c30000); nowMonRef: 35930.611; lasMontRef: 35920.639; lastSynthAnchor: 35930.626; lastGM: 0xa55e608d88c30000; offset 0.000; lastRefTimelineAnchor: 35930.626
default 18:23:20.188215+0000 aggregated {"msg":"CLCopyAppsUsing
@fabriziomoscon
fabriziomoscon / AnyJunk-redux-models-component.js
Last active February 28, 2018 16:04
Models allow code reuse between Components and reducers' action creators
// @flow
// model Collection
import Maybe from 'folktale/data/maybe'
import Result from 'folktale/data/result'
const MAX_VOLUME = 100
type CollectionState = {
volume: number,
}
@fabriziomoscon
fabriziomoscon / AnyJunk-collection-functional.js
Last active February 28, 2018 15:31
checking the validity of collectionVolume in a functional way
// @flow
import Maybe from 'folktale/data/maybe'
import Result from 'folktale/data/result'
const MAX_VOLUME = 100
type CollectionState = {
volume: number,
}
function safeGetCollectionVolume(data: CollectionState): Maybe<number> {
@fabriziomoscon
fabriziomoscon / AnyJunk-collection-imperative.js
Last active February 28, 2018 15:02
checking the validity of collectionVolume in an imperative way
// @flow
const MAX_VOLUME = 100
type CollectionState = {
volume: number,
}
function getCollectionVolume(data: CollectionState): number {
if (data && data.volume) {
return data.volume
}
09-24 18:13:49.653 13705-13705/com.numberhack.debug D/MediaManager: play complete for stream 3
09-24 18:13:49.653 13705-13798/com.numberhack.debug I/PJSIP: 18:13:49.653 pjsua_call.c !Making call with acc #1 to sip:APde3a1b29ff38016f26408480f294b08c@chunderm.gll.twilio.com;transport=TLS
09-24 18:13:49.653 13705-13798/com.numberhack.debug I/PJSIP: 18:13:49.653 pjsua_aud.c .Set sound device: capture=-1, playback=-2
09-24 18:13:49.653 13705-13798/com.numberhack.debug I/PJSIP: 18:13:49.653 pjsua_aud.c ..Opening sound device (speaker + mic) PCM@16000/1/20ms
09-24 18:13:49.653 13705-13798/com.numberhack.debug I/PJSIP: 18:13:49.653 opensl_dev.c ...Creating OpenSL stream
09-24 18:13:49.654 13705-13798/com.numberhack.debug W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 1, track 16000 Hz, output 44100 Hz
09-24 18:13:49.655 13705-13798/com.numberhack.debug W/AudioRecord: AUDIO_INPUT_FLAG_FAST denied by client; transfer 1, track 16000 Hz, primary 44100 Hz
09-24 18:13:49.656 13705-13798/com.nu
box: golang
services:
- id: mongo:latest
build:
steps:
- wercker/setup-go-workspace:
package-dir: bitbucket.org/numberhack/api
@fabriziomoscon
fabriziomoscon / notes.md
Last active December 13, 2015 20:46
Twilio ip messaging
{
origin: [
51.49451939999999,
-0.1823885
],
destination: {
"longitude": -0.4026852,
"latitude": 51.5526
},
@fabriziomoscon
fabriziomoscon / gist:5304084
Last active December 15, 2015 18:29
JavaScript difference between null, undefined and false in conditions
var isDefined = function (variable) {
if (variable) {
console.log( '=> ' + variable + ' defined' );
} else {
console.log( '=> %s \x1B[0;31mnot defined\x1B[0m', variable );
}
}
var list = [new Date, [], {}, function(){}, 1.1, 'not-empty', true, '', NaN, false, undefined, null];
@fabriziomoscon
fabriziomoscon / mongoLogger
Created March 13, 2013 10:27
mongoLogger is an object literal to pass to the mongo-node-native driver to produce formatted query log, very useful for development and testing environment. Not suitable for production. The binary log is present but commented out
mongoLogger =
error: (message, command) ->
console.log('\x1B[0;31mMongo ERR:\x1B[0m %s', message) if message?
console.log('\x1B[0;31mMongo ERR:\x1B[0m %s', command) if command?
log: (message, command) ->
console.log('\x1B[0;33mMongo LOG:\x1B[0m %s', message) if message?