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
/** | |
* InputFilter.js: unobtrusive filtering of keystrokes for <input> elements | |
* | |
* This module finds all <input type="text"> elements in the document that | |
* have an "data-allowed-chars" attribute. It registers keypress, textInput, and | |
* textinput event handlers for any such element to restrict the user's input | |
* so that only characters that appear in the value of the attribute may be | |
* entered. If the <input> element also has an attribute named "data-messageid", | |
* the value of that attribute is taken to be the id of another document | |
* element. If the user types a character that is not allowed, the message |
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
/* | |
* The DnD API is quite complicated, and browsers are not fully interoperable. | |
* This example gets the basics right, but each browser is a little different | |
* and each one seems to have its own unique bugs. This code does not attempt | |
* browser-specific workarounds. | |
*/ | |
whenReady(function() { // Run this function when the document is ready | |
// Find all <ul class='dnd'> elements and call the dnd() function on them | |
var lists = document.getElementsByTagName("ul"); | |
var regexp = /\bdnd\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
// Enclose the content element in a frame or viewport of the specified width | |
// and height (minimum 50x50). The optional contentX and contentY arguments | |
// specify the initial offset of the content relative to the frame. (If | |
// specified, they must be <= 0.) The frame has mousewheel event handlers that | |
// allow the user to pan the element, and to shrink or enlarge the frame. | |
function enclose(content, framewidth, frameheight, contentX, contentY) { | |
// These arguments aren't just the initial values: they maintain the | |
// current state and are used and modified by the mousewheel handler. | |
framewidth = Math.max(framewidth, 50); | |
frameheight = Math.max(frameheight, 50); |
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 selenium import webdriver | |
import unittest | |
class NewVisitorTest(unittest.TestCase): | |
def setUp(self): | |
self.browser = webdriver.Firefox() | |
def tearDown(self): | |
self.browser.quit() | |
def test_can_start_a_list_and_retrieve_it_later(self): |
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
'use strict'; | |
var mysql = require('mysql'), | |
http = require('http'), | |
url = require('url'), | |
querystring = require('querystring'); | |
// Start a web server on port 8888. Requests go to function handleRequest |
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
'use strict'; | |
var mysql = require('mysql'); | |
var connection = mysql.createConnection({ host: 'localhost', | |
user: 'root', | |
password: 'root' | |
}); | |
connection.query('CREATE DATABASE node', function(err) { if (err) { | |
console.log('Could not create database "node".'); | |
} | |
}); |
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
***Network Topology for EIGRP Configuration*** | |
R1 Router | |
R1>enable | |
Enters privileged mode. | |
R1#config t | |
Moves to global configuration mode. |
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
***In this example, it is assumed that | |
the MPLS network is configured with the MPLS PE | |
devices participating in the EIGRP process and virtual route forwarding. | |
Only the client-side EIGRP configuration is shown here.*** | |
R1 Router | |
R1(config)#interface fastethernet0/0 | |
Enters interface configuration mode |
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
***Network Topology for EIGRP over Frame Relay Using Dynamic Mappings*** | |
R1(config)#interface serial0/0/0 | |
Enters interface configuration mode | |
R1(config-if)#ip address 192.168.1.101 255.255.255.0 | |
Assigns the IP address and mask | |
R1(config-if)#encapsulation frame-relay | |
Enables Frame Relay on this interface |
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
public class AwesomeServer : IServer | |
{ | |
public AwesomeServer(IOptions<AwesomeServerOptions> options) | |
{ | |
Features.Set<IHttpRequestFeature>(new HttpRequestFeature()); | |
Features.Set<IHttpResponseFeature>(new HttpResponseFeature()); | |
var serverAddressesFeature = new ServerAddressesFeature(); | |
serverAddressesFeature.Addresses.Add(options.Value.FolderPath); | |
Features.Set<IServerAddressesFeature>(serverAddressesFeature); | |
} |