This file contains hidden or 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
/build |
This file contains hidden or 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
// Java stateless service that extracts and orders a list of nodes | |
public class SomeService { | |
// this would be an example implementation of a service that retrieves a given list of nodes by one property (i.e. name) | |
// and ordering the list by another property (i.e. value) and returns it with the highest value first | |
public static List loveMeSomeData(GraphDatabaseService service, String[] nodeNames) { | |
//grabbing the nodes by the list of names | |
HashMap<String, Integer> list = new HashMap<>(); | |
for (String name : nodeNames) { |
This file contains hidden or 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
require 'javable' | |
#this example uses neo4j.rb. | |
class Bridge < Neo4j::Rails::Model | |
include Javable | |
require_jar_folder #by default imports all .jar files from lib/ | |
def initialize | |
super | |
#Create a ruby instance from the full java class name |
This file contains hidden or 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
require 'thread' | |
class Mgr | |
# This initiates the queue and the threads | |
def self.run | |
@mutex = Mutex.new | |
@cv = ConditionVariable.new | |
@working = true | |
@clue_bank = 0 | |
10.times{|i| |
This file contains hidden or 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
angular.module('myapp.component', ['ngResource']).factory('MyService', function($resource) { | |
return $resource('http://giladmanor.com\\:3000/t/t', {alt: 'json', callback: 'JSON_CALLBACK'}, | |
{ 'send': { method: 'JSONP'}}); | |
}); |
This file contains hidden or 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
angular.module('myApp.context', []).factory('Context', function($rootScope, $location) { | |
return { | |
'contentTypeFilter': "All", | |
'contentScopeFilter': "pub", | |
'focusedItemId': -1, | |
'profileData':{}, | |
'broadcast': function(eventName){ | |
console.log("! Broadcasting: "+ eventName); | |
$rootScope.$broadcast( eventName ); | |
}, |
This file contains hidden or 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
def get_token | |
token = "AKA #{params[:id]} #{Time.now.to_f}".hash | |
Rails.cache.write(token,params[:id], :timeToLive => 60.seconds) | |
render :json => token | |
end | |
def use_token | |
session[:user_id] = Rails.cache.read(params[:token]) | |
redirect_to "/" | |
end |