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
| 'tis | |
| 'twas | |
| a | |
| aah | |
| aaron | |
| abandon | |
| abandoned | |
| abbott | |
| abby | |
| abe |
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
| function GetRandomBackground() | |
| { | |
| var url = 'http://unsplash.com/rss'; | |
| $.ajax({ | |
| url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&callback=?&q=' + encodeURIComponent(url), | |
| async: false, | |
| jsonpCallback: 'jsonCallback', | |
| contentType: "application/json", |
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
| #!/usr/bin/env python | |
| # | |
| # Copyright 2007 Google Inc. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # |
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
| //Encrypt data, call callback when done for make sure everything is done. | |
| function EncryptText(text,key,callback) { | |
| console.log('Encrypting text'); | |
| var cipher = crypto.createCipher('aes-256-cbc',key) | |
| var crypted = cipher.update(text,'utf8','hex') | |
| crypted += cipher.final('hex'); |
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
| function setWeatherIcon(condid) { | |
| switch(condid) { | |
| case '0': var icon = '<i class="wi-tornado"></i>'; | |
| break; | |
| case '1': var icon = '<i class="wi-storm-showers"></i>'; | |
| break; | |
| case '2': var icon = '<i class="wi-tornado"></i>'; | |
| break; | |
| case '3': var icon = '<i class="wi-thunderstorm"></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
| chrome.pageCapture.saveAsMHTML({'tabId':1654}, function(mhtmlData){ | |
| var reader = new FileReader(); | |
| reader.readAsText(mhtmlData); | |
| reader.onloadend = function() { | |
| var html = reader.result; | |
| d = document.createElement('div'); |
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
| //Socket server connect to listen to data. | |
| $.getScript('http://yoursocketioserver/socket.io/socket.io.js',function() { | |
| socket = io.connect('http://lyoursocketioserver'); | |
| socket.on('connect', function(){ | |
| socket.on('message', function (data) { | |
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
| /* | |
| Very simple solution for fighting renegade connections that try to overflood your socket.io server and kill your nodejs. | |
| This limits number of connections and sends disconnect to the rest. | |
| You can expend it by saving IP list in memory and handle uniqueness per IP also if you wish. | |
| */ | |
| //Start count | |
| var connections = 0; | |
| var maxconnections = 1000; |
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 selection = document.getSelection(); | |
| var cursorPos = selection.anchorOffset; | |
| var oldContent = selection.anchorNode.nodeValue; | |
| var toInsert = '_BUTTON_'; | |
| var newContent = oldContent.substring(0, cursorPos) + toInsert + oldContent.substring(cursorPos); |
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
| AtomAdapter.prototype.setOtherCursor = function(cursor, color, clientId) { | |
| var clazz, css, cursorRange, end, justCursor, start, _ref, | |
| _this = this; | |
| if (this.otherCursors == null) { | |
| this.otherCursors = {}; | |
| } | |
| cursorRange = this.otherCursors[clientId]; | |
| if (cursorRange) { |
OlderNewer