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
| from __future__ import print_function | |
| from tornado.gen import Task, Return, coroutine | |
| import tornado.process | |
| from tornado.ioloop import IOLoop | |
| import subprocess | |
| import time | |
| STREAM = tornado.process.Subprocess.STREAM |
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
| """ | |
| This is a simple example of WebSocket + Tornado + Simple EventEmitters usage. | |
| Thanks to pyee by https://github.com/jesusabdullah | |
| @Author:: Narayanaperumal G <[email protected]> | |
| """ | |
| import tornado.httpserver | |
| import tornado.websocket | |
| import tornado.ioloop | |
| import tornado.web | |
| from collections import defaultdict |
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
| """A simple demonstration of running background tasks with Tornado. | |
| Here I am using a basic TCP server which handles streams and keeps | |
| them open while asynchronously performing a fake task in the | |
| background. In order to test it, simply telnet to localhost port 8080 | |
| and start typing things to see that the server receives the messages. | |
| The advantage to running on an executor instead of conventional | |
| threads is that we can more easily shut it down by stopping the | |
| tornado IO loop. |
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
| Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User | |
| Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User | |
| Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User | |
| [ | |
| { | |
| "button": "button1", | |
| "count": 1, | |
| "modifiers": ["ctrl"], | |
| "press_command": "drag_select", |
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
| import win32serviceutil | |
| import win32service | |
| import win32event | |
| import servicemanager | |
| import socket | |
| import time | |
| import logging | |
| logging.basicConfig( | |
| filename = 'c:\\Temp\\hello-service.log', |
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
| <% | |
| import java.text.DateFormat | |
| import java.text.SimpleDateFormat | |
| %> | |
| <STYLE> | |
| BODY, TABLE, TD, TH, P { | |
| font-family:Verdana,Helvetica,sans serif; | |
| font-size:11px; | |
| color:black; | |
| } |
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 init = function() { | |
| //.. do some overall initialization | |
| $.ajax({ | |
| url: '/url/', | |
| method: 'GET', | |
| dataType: 'json', | |
| data: {}, //probably you have some parameters | |
| success: displaygraph, | |
| error: function() {alert('error getting 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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| # All Vagrant configuration is done here. The most common configuration | |
| # options are documented and commented below. For a complete reference, | |
| # please see the online documentation at vagrantup.com. |
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
| # Setting up internet explorer machine with selenium | |
| Download the machine with appropriate windows and IE from microsoft | |
| https://www.modern.ie/en-us/virtualization-tools | |
| Boot it up with GUI | |
| Disable UAC and firewall - its an isolated machine that noone will access anyway(and if they do, theres really nothing there), so why bother | |
| # Copssh |
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
| package main | |
| import ( | |
| "fmt" | |
| "path/filepath" | |
| ) | |
| func main() { | |
| filename := "start.txt" |
OlderNewer