- Copy or SFTP certificate to machine
- Go to /usr/local/share/ca-certificates/
- Create a new folder, i.e. "sudo mkdir my-cert"
- Copy the .crt file into the my-cert folder
- Make sure the permissions are OK (
755
for the folder,644
for the file) - Run
sudo update-ca-certificates
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
def flatten_json(nested_json): | |
""" | |
Flatten json object with nested keys into a single level. | |
Args: | |
nested_json: A nested json object. | |
Returns: | |
The flattened json object if successful, None otherwise. | |
""" |
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 imagetyperzapi2 | |
#... then go to the page using a webdriver object called driver | |
try: | |
driver.find_element_by_xpath("//*[@data-sitekey]") | |
captcha = True | |
except NoSuchElementException: | |
captcha = False |
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
worker_processes 5; ## Default: 1 | |
error_log logs/error.log; | |
pid logs/nginx.pid; | |
worker_rlimit_nofile 8192; | |
events { | |
worker_connections 4096; ## Default: 1024 | |
} | |
http { |
http://angular.github.io/protractor/#/api
Note: Most commands return promises, so you only resolve their values through using jasmine expect API or using .then(function()) structure
Based on this post: https://spagettikoodi.wordpress.com/2015/01/14/angular-testing-cheat-sheet/ by @crystoll
browser.get('yoururl'); // Load address, can also use '#yourpage'
This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:
- TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
- In the wild, we're seeing
(async main(){...}())
as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems - Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.
I'll leave the rest of this document unedited, for archaeological
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
/* | |
Solution for HackerRank > Algorithms > Warmup > Staircase | |
https://www.hackerrank.com/challenges/staircase | |
*/ | |
function main() { | |
var n = 6; | |
var space, hash, stair; | |
for (var i = 0; i < n; 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
import { browser, by, protractor, element, promise, ElementFinder, ElementArrayFinder } from 'protractor'; | |
describe('Test', () => { | |
var originalTimeout; | |
beforeEach(() => { | |
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL; | |
jasmine.DEFAULT_TIMEOUT_INTERVAL = 120000; | |
browser.driver.sleep(3000); | |
}); |
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
const { SpecReporter } = require('jasmine-spec-reporter') | |
exports.config = { | |
allScriptsTimeout: 110000, | |
getPageTimeout: 110000, | |
specs: [ | |
'./e2e/**/example.e2e-spec.ts', | |
], | |
capabilities: { | |
browserName: 'chrome' |
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
require("dotenv").config(); | |
const fetch = require("node-fetch"); | |
var Guid = require("guid"); | |
var sha256 = require("sha256"); | |
var jwt = require("jsonwebtoken"); | |
var app = require("express")(), | |
port = process.env.PORT || 8040, | |
// Skype Interview Payload |
NewerOlder