This file contains 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"; | |
const http = require('http'); | |
const request = http.request; | |
const net = require('net'); | |
const httpProxy = require('http-proxy'); | |
let auth = "secret-string"; | |
auth = new Buffer(auth).toString('base64'); | |
auth = "Basic " + auth; |
This file contains 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
grunt: | |
only: | |
- master | |
script: | |
- 'git checkout -b CI${CI_JOB_ID}' | |
#make changes on local repo | |
- 'git add . || true' | |
- 'git commit -a -m "[ci skip] build" || true' | |
- 'git push https://<username>:<token>@gitlab.com/<team>/<project>.git HEAD:CI${CI_JOB_ID} || true' | |
- 'node ./mergeBranch.js CI${CI_JOB_ID}' |
This file contains 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"; | |
const Promise = require('bluebird'); | |
const Page = require('puppeteer/node6/lib/Page'); | |
function newPageWithNewContext(browser) { | |
let browserContextId; | |
let targetId; | |
let target; | |
return Promise.resolve() |
This file contains 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
const createElementBackup = document.createElement; | |
function myCreateElement(tagName: string, options?: ElementCreationOptions): HTMLElement { | |
const scriptElt = createElementBackup.call(document, tagName, options); | |
if (tagName.toLowerCase() !== 'script') { | |
return scriptElt; | |
} | |
const originalSetAttribute = scriptElt.setAttribute.bind(scriptElt); | |
Object.defineProperties(scriptElt, { | |
'src': { | |
get() { |
This file contains 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
const scriptElement = document.createElement('script'); | |
scriptElement.setAttribute('src','//s7.addthis.com/js/300/addthis_widget.js'); | |
const headElement = document.getElementsByTagName('head')[0]; | |
head.appendChild(scriptElement); |
This file contains 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
const pixel = new Image(); | |
pixel.src = '//googlepixel.com/id=12345'; |
This file contains 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
// Load the AWS SDK for Node.js | |
var AWS = require('aws-sdk'); | |
var awsConfig = { | |
accessKeyId: '<accessKeyId>', | |
secretAccessKey: '<secretAccessKey>', | |
region: '<region>' | |
}; | |
AWS.config.update(awsConfig); | |
// Create an SQS service object |
This file contains 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 {Squiss, Message} from 'squiss-ts'; | |
const awsConfig = { | |
accessKeyId: '<accessKeyId>', | |
secretAccessKey: '<secretAccessKey>', | |
region: '<region>', | |
}; | |
const squiss = new Squiss({ | |
awsConfig, |
This file contains 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'; | |
// tslint:disable:max-line-length | |
// based on https://www.reddit.com/r/typescript/comments/aynx0o/safe_deep_property_access_in_typescript | |
import * as fs from 'fs'; | |
const method = 'getProp'; | |
const TAB = ` `; |
This file contains 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'; | |
import * as textVersion from 'html-to-text'; | |
import * as mysql from 'mysql'; | |
import * as _ from 'underscore'; | |
const connection = mysql.createConnection({ | |
host: '<host>', | |
user: '<user>', | |
password: '<password>', | |
database: 'mautic', |
OlderNewer