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
# Configuration file for the audio service | |
# This section contains options which are not specific to any | |
# particular interface | |
[General] | |
# Allow PulseAudio to connect by default | |
# https://bugzilla.redhat.com/show_bug.cgi?id=964031 | |
Enable=Sink,Control,Gateway,Source,Headset | |
Disable=Socket |
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
<!-- This configuration file specifies the required security policies | |
for Bluetooth core daemon to work. --> | |
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" | |
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> | |
<busconfig> | |
<!-- ../system.conf have denied everything, so we just punch some holes --> | |
<policy user="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
var http = require('q-io/http'), | |
BufferStream = require('q-io/buffer-stream'), | |
Url = require('url'), | |
_ = require('underscore'), | |
version = require('../../package.json').version, | |
debug = require('debug')('blaze-in:middleware:minecraft'), | |
inspect = require('sys').inspect, | |
sprintf = require('util').format, | |
uuid = require('node-uuid'); |
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
import java.util.HashMap; | |
import org.json.JSONArray; | |
import com.embedly.api.Api; | |
... | |
Api api = new Api('Mozilla/5.0 (compatible; mytestapp/1.0; my@email.com)'); | |
HashMap<String, Object> params = new HashMap<String, Object>(); | |
params.put('url', 'http://www.youtube.com/watch?v=sPbJ4Z5D-n4&feature=topvideos'); | |
JSONArray oembed = api.oembed(params); |
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
String play = "var i=document.getElementsByClassName('embedly-embed')[0];var p=new playerjs.Player(i);p.on('ready', function(){p.play()});"; | |
embedWebView.getSettings().setMediaPlaybackRequiresUserGesture(false); | |
embedWebView.evaluateJavascript(play, null); |
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
# Change hadoop version to your liking, don't include kinesis-acl profile unless you are using aws kinesis | |
$ git clone git@github.com:apache/spark | |
$ cd spark | |
$ mvn -DskipTests=true -Dhadooop.version=2.6.0 -Phadoop-2.6,kinesis-asl clean package install | |
# In my build.sbt: | |
[..snip..] | |
val sparkVersion = "1.4.0" | |
val hadoopVersion = "2.6.0" | |
libraryDependencies += "org.apache.spark" %% "spark-core" % sparkVersion % "provided" |
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
lines.repartition(1).foreachRDD((rdd: RDD[_], time: Time) => { | |
val file = backupPath + "-" + time.milliseconds | |
if ("".equals(compressionCodec)) { | |
rdd.saveAsTextFile(file) | |
} else { | |
val codec = Class.forName(compressionCodec).asInstanceOf[Class[_ <: org.apache.hadoop.io.compress.CompressionCodec]] | |
rdd.saveAsTextFile(file, codec) | |
} | |
}) |
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
$ PYTHONPATH="$PYTHONPATH:DOESNT_GET_TO_WORKER" pyspark | |
[..snip..] | |
In [1]: import os | |
In [2]: os.environ['PYTHONPATH'] | |
Out[2]: '/mnt/spark/python/lib/py4j-0.8.2.1-src.zip:/mnt/spark/python/:DOESNT_GET_TO_WORKER' | |
In [3]: sc.parallelize([1]).map(lambda x: os.environ['PYTHONPATH']).first() |
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
a = u'Ա Բ Գ Դ Ե Զ Է Ը Թ Ժ Ի Լ Խ Ծ Կ Հ Ձ Ղ Ճ Մ Յ Ն Շ Ո Չ Պ Ջ Ռ Ս Վ Տ Ր Ց Ւ Փ Ք Օ Ֆ ՙ ՚ ՛ ՜ ՝ ՞ ՟ ա բ գ դ ե զ է ը թ ժ ի լ խ ծ կ հ ձ ղ ճ մ յ ն շ ո չ պ ջ ռ ս վ տ ր ց ւ փ ք օ ֆ և ։' | |
len(a.encode('punycode')) # 257 | |
len(a.encode('utf-8')) # 254 |
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
/** | |
* Luhn's algorithm in javascript with prototype. | |
* | |
* This is used for credit card number validation. | |
* | |
* You'll have to scrub the number before passing it in. If any | |
* non-numeric characters are passed then this will fail. | |
* | |
* @see http://en.wikipedia.org/wiki/Luhn_algorithm | |
*/ |
OlderNewer