View download.ts
#! /usr/bin/env ts-node --transpile-only | |
import { createWriteStream, readFileSync, writeFileSync } from "fs"; | |
import { basename, extname } from "path"; | |
import { createHash } from "crypto"; | |
const s3Url = | |
"https://example-video-player-debugging-temporary.s3.amazonaws.com"; | |
const fetch = require("node-fetch"); | |
async function getPlaylist() { |
View package.json
{ | |
"name": "ldif-parse", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"dependencies": { | |
"ldif": "^0.5.1" | |
} | |
} |
View Dockerfile
FROM node:alpine | |
WORKDIR /app | |
COPY server.js . | |
CMD node /app/server.js |
View dic-test.js
'use strict'; | |
const should = require('should'); | |
const DiC = require('../../lib/DependencyInjectionContainer'); | |
/** | |
* @class Service class test fixture. | |
*/ | |
class Foo { | |
constructor() { |
View kanye-socket.js
const net = require('net'); | |
const https = require('https'); | |
const filePath = '/tmp/kanye'; | |
const server = net.createServer(async (stream) => { | |
stream.end(await getKanyeQuote() + '\n'); | |
}); | |
server.listen(filePath, () => { |
View csv-dump.js
'use strict' | |
const fs = require('fs'); | |
const os = require('os'); | |
const file = fs.readFileSync('./dump.txt', 'utf8').split(os.EOL); | |
const people = []; | |
const groups = new Set(); | |
var current_person = false; |
View deploy_hosted_app.js
const fs = require('fs'); | |
var request = require('request'); | |
request = request.defaults({jar: true}); | |
// The appid from the hosted app. | |
const appid = 'XXX'; | |
const body = { | |
email: 'someone@somewhere.com', | |
password: 'XXX', | |
} | |
const headers = { |
View install_drush_in_freenas_jail.sh
#! /usr/bin/env bash | |
echo 'Installing dependencies php and git...' | |
echo '' | |
echo '' | |
echo '' | |
pkg install -y php70 git php70-json php70-ctype php70-phar php70-iconv php70-openssl | |
echo '' | |
echo '' |
View crypto.php
<?php | |
/**************************** | |
* Generate a new key pair. * | |
****************************/ | |
$privateKey = openssl_pkey_new(array( | |
'private_key_bits' => 2048, // Size of Key. | |
'private_key_type' => OPENSSL_KEYTYPE_RSA, |
View d3.v3.min.js
!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function r(n){return null===n?NaN:+n}function i(n){return!isNaN(n)}function u(n){return{left:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)>0?i=u:r=u+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function f(n){return(n+="")===bo||n[0]===_o?_o+n:n}function s(n){return(n+="")[0]===_o?n.slice(1):n}function h(n){return f(n)in this._}function p(n){return(n=f(n))in this._&&delete this._[n]}function g(){var n=[] |
NewerOlder