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 express = require('express'); | |
| var app = express(); | |
| var mcache = require('memory-cache'); | |
| app.set('view engine', 'jade'); | |
| var cache = (duration) => { | |
| return (req, res, next) => { |
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 net = require('net'); | |
| var Promise = require('bluebird'); | |
| function checkConnection(host, port, timeout) { | |
| return new Promise(function(resolve, reject) { | |
| timeout = timeout || 10000; // default of 10 seconds | |
| var timer = setTimeout(function() { | |
| reject("timeout"); | |
| socket.end(); | |
| }, timeout); |
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
| select | |
| n.nspname as "Schema" | |
| ,t.relname as "Table" | |
| ,c.relname as "Index" | |
| from | |
| pg_catalog.pg_class c | |
| join pg_catalog.pg_namespace n on n.oid = c.relnamespace | |
| join pg_catalog.pg_index i on i.indexrelid = c.oid | |
| join pg_catalog.pg_class t on i.indrelid = t.oid | |
| where |
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
| using System; | |
| using System.Collections.Generic; | |
| class Drama | |
| { | |
| public string name; | |
| public List<string> actors; | |
| Drama(string 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
| <?php | |
| $dsn = 'mysql:host=localhost;port=3307;dbname=testdb'; | |
| $username = 'username'; | |
| $password = 'password'; | |
| $options = array(); | |
| $db = new PDO($dsn, $username, $password, $options); | |
| $name = $_GET['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
| SELECT sc.name +'.'+ ta.name TableName | |
| ,SUM(pa.rows) RowCnt | |
| FROM sys.tables ta | |
| INNER JOIN sys.partitions pa | |
| ON pa.OBJECT_ID = ta.OBJECT_ID | |
| INNER JOIN sys.schemas sc | |
| ON ta.schema_id = sc.schema_id | |
| WHERE ta.is_ms_shipped = 0 AND pa.index_id IN (1,0) | |
| GROUP BY sc.name,ta.name | |
| ORDER BY SUM(pa.rows) DESC |
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
| http { | |
| gzip off; | |
| # need to setup external DNS resolver | |
| resolver 8.8.8.8; | |
| resolver_timeout 5s; | |
| # configure cache directory with 750G and holding old objects for max 30 days | |
| proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=default:500m max_size=750g inactive=30d; |
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
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| default_type text/html; | |
| access_log /dev/stdout; | |
| sendfile on; | |
| keepalive_timeout 65; |
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
| ; AutoIt Version: 3.0 | |
| ; Language: English | |
| ; Platform: Win9x/NT | |
| ; Author: ESB | |
| #Region Include | |
| #include <Math.au3> | |
| #include <ButtonConstants.au3> |
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
| <?php | |
| if(isset($_POST['username']) && isset($_POST['password'])){ | |
| $adServer = "ldap://domaincontroller.mydomain.com"; | |
| $ldap = ldap_connect($adServer); | |
| $username = $_POST['username']; | |
| $password = $_POST['password']; | |
| $ldaprdn = 'mydomain' . "\\" . $username; |