#!/usr/bin/python
# function that accepts 2 arrays.
# The arrays contain numbers and each input array is already sorted in increasing order.
# The function should create and return another array which contains all of the numbers that are in the 2 input arrays.
# The numbers in the returned array should also be sorted in increasing order
# Example usage: python process_numbers.py [1,10,3,22,23,4,2,200,201,202,203,204,205,206,207,207,209] [5,8,9,11,25]
import sys
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
| #!/usr/bin/env python | |
| import os | |
| import argparse | |
| import binascii | |
| from sys import argv, stdout | |
| # default values | |
| DEFAULT_ENTROPY = 4096*16 |
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'; | |
| const EventEmitter = require('events').EventEmitter; | |
| const SomeClass = (() => { | |
| class SomeClass extends SomeOtherClass { | |
| constructor() { | |
| super(); | |
| EventEmitter.call(this); | |
| } |
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
| /* Sample JavaScript file added with ScriptTag resource. | |
| This sample file is meant to teach best practices. | |
| Your app will load jQuery if it's not defined. | |
| Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7. | |
| Your app does not change the definition of $ or jQuery outside the app. | |
| Example: if a Shopify theme uses jQuery 1.4.2, both of these statements run in the console will still return '1.4.2' | |
| once the app is installed, even if the app uses jQuery 1.9.1: | |
| jQuery.fn.jquery => "1.4.2" | |
| $.fn.jquery -> "1.4.2" | |
| */ |
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
| #!/bin/bash | |
| #Shell script that pulls down and clones all available repos for an organization - can be used as a "backup" utility | |
| #Pre-reqs = jsawk https://github.com/micha/jsawk | |
| #don't forget to export out your username and password as variables or maybe add a couple of parameters to accept them as input args | |
| #export GITHUB_USERNAME=my_github_username | |
| #export GITHUB_PASSWORD=my_github_password | |
| echo "getting list of available repos" | |
| PAGE_NUMBER=1 | |
| ORG=$1 |
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
| #!/bin/bash | |
| PWD=`pwd` | |
| echo "configuring es_river(s)" | |
| # return a list of collections except the system tables | |
| collections=`mongo --host ${MONGODB_SERVER} --username ${MONGODB_USER} --password ${MONGODB_PASSWORD} ${MONGODB_DATABASE} --eval 'db.getCollectionNames().filter(function (c) { return /^((?!system).)*$/.test(c) && /^((?!sessions).)*$/.test(c) })' | sed -n '3p' | sed 's/,/ /g'` | |
| echo "collections: ${collections}" |
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
| // Send cookies for the socket.io handshake (sails.js) | |
| // Based on https://gist.github.com/jfromaniello/4087861 | |
| // Socket.io open ticket (started by jfromaniello): | |
| // https://github.com/LearnBoost/socket.io-client/pull/512 | |
| var io = require('socket.io-client'); | |
| var request = require('request'); | |
| var xhr = require('socket.io-client/node_modules/xmlhttprequest'); | |
| var xhrOriginal = require('xmlhttprequest'); |
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
| /* Sample JavaScript file added with ScriptTag resource. | |
| This sample file is meant to teach best practices. | |
| Your app will load jQuery if it's not defined. | |
| Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7. | |
| Your app does not change the definition of $ or jQuery outside the app. | |
| Example: if a Shopify theme uses jQuery 1.4.2, both of these statements run in the console will still return '1.4.2' | |
| once the app is installed, even if the app uses jQuery 1.9.1: | |
| jQuery.fn.jquery => "1.4.2" | |
| $.fn.jquery -> "1.4.2" | |
| */ |
NewerOlder