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 likes = [1,1,1,4,5,6,7,8,9]; | |
var response = false; | |
client.sadd('temp:comparator', likes, function (err, data) { | |
client.sdiff('temp:comparator', 'set:zara', function (err, data) { | |
console.log(data); | |
if (data.length > 0) { | |
client.sadd('set:zara', data, redis.print); | |
client.del('temp:comparator', redis.print); | |
data.forEach(function (elem) { |
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.ArrayList; | |
import java.util.List; | |
/** | |
* Generic enabled Object Oriented Switch/Case construct | |
* @param <T> type to switch on | |
*/ | |
public class Switch<T extends Comparable<T>> | |
{ | |
private final List<Case<T>> cases; |
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
android.libraryVariants.all { variant -> | |
def name = variant.buildType.name | |
if (name.equals(com.android.builder.BuilderConstants.DEBUG)) { | |
return; // Skip debug builds. | |
} | |
def task = project.tasks.create "jar${name.capitalize()}", Jar | |
task.dependsOn variant.javaCompile | |
//Include Java classes | |
task.from variant.javaCompile.destinationDir | |
//Include dependent jars with some exceptions |
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
sudo add-apt-repository ppa:chris-lea/zeromq | |
sudo apt-get update | |
sudo apt-get install libzmq3-dbg libzmq3-dev libzmq3 |
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
I found a solution for the OSMC start/stop issue using openvt & nohup. Thanks to mkobit for the OSMC/RetroPie scripts (https://github.com/mcobit/retropie-osmc). | |
First we need to install kdb & libopus-dev: | |
apt-get update | |
apt-get install kbd | |
apt-get install libopus-dev | |
Code of my scripts: | |
/home/limelight/limelight.sh: |
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
<html> | |
<head> | |
<title>About Me</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700" rel="stylesheet"> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body> | |
<main> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="socialtech.com.triboo" | |
> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" | |
android:supportsRtl="true" |
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
public class BitmapScaler | |
{ | |
// scale and keep aspect ratio | |
public static Bitmap scaleToFitWidth(Bitmap b, int width) | |
{ | |
float factor = width / (float) b.getWidth(); | |
return Bitmap.createScaledBitmap(b, width, (int) (b.getHeight() * factor), true); | |
} | |
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
/* Place model */ | |
module.exports = { | |
attributes: { | |
name: { | |
type: 'string', | |
required: true | |
}, |
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
// proximity using (slightly) limited native.geoNear | |
geoProximity: function (req,res) { | |
console.log('MeetingsController: action=geoProximity '); | |
console.log(' req.isSocket ', req.isSocket); | |
console.log(' req.isAjax ', req.isAjax); | |
console.log(' req.isJson ', req.isJson); | |
var lat = parseFloat(req.param('lat')); | |
var lng = parseFloat(req.param('lng')); | |
var maxDistance = req.param('maxDistance') || 1000; |
OlderNewer