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
}.call(this), function() { | |
var bind = function(fn, me) { | |
return function() { | |
return fn.apply(me, arguments); | |
}; | |
}; | |
// IIFE - gets run immediately: | |
!function() { |
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
/* | |
Array One Array Two Result | |
["a"] ["a"] => True | |
["ab"] ["ac"] => False | |
["aa"] ["ab"] => False | |
["cbb"] ["abbc"] => True | |
["abbccdd"] ["abbcccdd"] => True | |
*/ | |
function check(a, b){ |
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
// Name == ionox0 | |
process.stdin.resume(); | |
process.stdin.setEncoding("ascii"); | |
var input = ''; | |
process.stdin.on("data", function(chunk){ | |
input += chunk; | |
}); | |
process.stdin.on("end", function(){ | |
findAntecedent(input); |
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
var items = [1, 2, 5, 134, 234, 324, 234, 324, 23, 234, 23, 234, 234, 523, 523, 235, 235, 23, 235, 2354, 2354, 23, 45, 23, 4, 2, 7, 4, 67, 3]; | |
console.time('insertionsort'); | |
console.log(insertionsort(items)); | |
console.timeEnd('insertionsort'); | |
console.time('quicksort'); | |
console.log(quicksort(items, 0, items.length-1)); | |
console.timeEnd('quicksort'); |
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
class MyClass { | |
public static void check_anagrams(String[] firstWords, String[] secondWords) { | |
String characters = "abcdefghijklmnopqrstuvwxyz"; | |
int[] primes = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101}; | |
for (int i = 0; i < firstWords.length; i++){ | |
char a; | |
char b; | |
int firstWordValue = 1; | |
int secondWordValue = 1; | |
for (int j = 0; j < firstWords[i].length(); j++){ |
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
Device Tokens curling: | |
GET------------------------------- | |
curl 'http://api.local.mimedia.com:8080/2.0/deviceToken' -X GET -H 'X-MiMedia-Session-Key: -90948020389859841180276180322974804394' -H 'Content-Type: application/json' -H 'Accept: application/json' --compressed | |
POST------------------------------ | |
(old) | |
curl 'http://api.local.mimedia.com:8080/2.0/deviceToken' -X POST -H 'X-MiMedia-Session-Key: -90948020389859841180276180322974804394' -H 'Content-Type: application/json' -H 'Accept: application/json' --data-binary '{"deviceToken":"a361a04345c93070e39af0150870499974d393bf625ccca987f0520bc59416ec","uuid":"b7c66d4345670021a94e14faf03c9594d3105676", "thirdPartyPushNotificationServer":"APPLE"}' --compressed | |
(new) | |
curl 'http://api.local.mimedia.com:8080/2.0/deviceToken' -X POST -H 'X-MiMedia-Session-Key: -90948020389859841180276180322974804394' -H 'Content-Type: application/json' -H 'Accept: application/json' --data-binary '{"deviceToken":"a361a04345c93070e39af0150870499974d393bf625ccca987f0520bc59416ec", "thi |
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
/**** | |
Implemented for gathering Allen Brain Atlas API data | |
[ionox0 - Allen Brain Visualizer](https://github.com/ionox0/Allen-Brain-Atlas-V2) | |
****/ | |
/*jshint esnext: true */ | |
var _ = require('underscore'); | |
var RSVP = require('rsvp'); | |
module.exports = { |
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
@MM.module 'DialogApp', (DialogApp, App, Backbone, Marionette, $, _) -> | |
@on | |
'start': -> | |
$('#dialog-region').on 'click.anywhere', (evt) -> | |
API.hide() | |
'stop': -> | |
$(document).add(App.contextMenuRegion.el).off('.anywhere') | |
API.hide() |
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
class AnagramChecker { | |
public static void check_anagrams(String[] firstWords, String[] secondWords) { | |
String characters = "abcdefghijklmnopqrstuvwxyz"; | |
int[] primes = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101}; | |
for (int i = 0; i < firstWords.length; i++){ | |
char a; | |
char b; | |
int firstWordValue = 1; | |
int secondWordValue = 1; | |
for (int j = 0; j < firstWords[i].length(); j++){ |
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
$(document).ready(function() { | |
ws = new WebSocket("ws://" + location.hostname + ":8080/"); | |
ws.onmessage = function(event) { | |
$("#messages").append("<p>" + event.data + "</p>"); | |
}; | |
ws.onclose = function() { | |
console.log("Socket closed"); | |
}; |