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 { Observable } from 'rx'; | |
import { EventEmitter } from 'events'; | |
import { Map as map } from 'immutable'; | |
// base para crear sockets | |
class Socket extends EventEmitter { | |
constructor(id) { | |
super(id); | |
this.id = 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
function asyncThread(fn, ...args) { | |
if (!window.Worker) throw Promise.reject( | |
new ReferenceError(`WebWorkers aren't available.`) | |
); | |
const fnWorker = ` | |
self.onmessage = function(message) { | |
(${fn.toString()}) | |
.apply(null, message.data) | |
.then(result => self.postMessage(result)); |
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 { renderToStream } from "@react-pdf/renderer"; | |
import ReactDOMServer from "react-dom/server"; | |
import { EntryContext, Headers, RemixServer, Request, Response } from "remix"; | |
import PDF, { loader } from "./pdfs/my-pdf.server"; | |
async function handlePDFRequest(request: Request, headers: Headers) { | |
// get the data for the PDF | |
let response = await loader({ request, context: {}, params: {} }); | |
// if it's a response return it, this means we redirected | |
if (response instanceof Response) return response; |
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 AWS = require("aws-sdk"); | |
const fetch = require("node-fetch"); | |
const crypto = require("crypto"); | |
const slackChannel = process.env.SLACK_CHANNEL_URL; | |
const githubSecret = process.env.WEBHOOK_SECRET; | |
const verifyGitHubSignature = (req = {}, secret = "") => { | |
const sig = req.headers["X-Hub-Signature"]; | |
const hmac = crypto.createHmac("sha1", secret); | |
const digest = Buffer.from( |
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
(function (root, factory) { | |
var name = "FooMod"; | |
var deps = ["this", "that", "whatnot"]; | |
if (typeof exports === "object") { | |
module.exports = factory.apply(undefined, deps.map(function (d) { return require(d); })); | |
} else if (typeof define === "function" && define.amd) { | |
define(deps, factory); | |
} else { |
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
el.set('contentEditable', true) | |
.addEvents({ | |
keydown: function(e){ if (e.key == 'enter') e.preventDefault(); }, | |
keypress: function(e){ if (e.event.which == 0 && e.code == 13) e.preventDefault(); }, | |
blur: function(){ var text = this.get('text'); this.set('text', text); } | |
}); |
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
# List users by average and maximum session length. | |
SELECT person, max(client.runtime_ms), avg(client.runtime_ms) | |
FROM item_occurrence | |
GROUP BY 1 | |
ORDER BY 2 DESC | |
# List active date ranges for each deploy. | |
SELECT client.javascript.code_version, min(timestamp), max(timestamp) | |
FROM item_occurrence | |
GROUP BY 1 |
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 { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
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'; | |
// 1. Revealing Module Pattern | |
var revModule = function (param) { | |
return { | |
// public | |
funk: funk | |
}; | |
// private |
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
**Individual Contributor License Agreement v3.0** | |
Thank you for Your interest in the Defunctr Open Source Project. This document clarifies the terms under which You, the person listed below, may make Contributions — which may include without limitation, software, bug fixes, configuration changes, documentation, art work, creative design, video, or any other materials — to any of the projects owned or managed by Cinecove Digital. | |
[Please complete information about You and the Contributions](#void). If You have questions about these terms, please contact us at [legal@cinecove.com](mailto:legal@cinecove.com). | |
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Defunctr Open Source Project. Except for the license granted herein to the Defunctr Open Source Project, You reserve all right, title, and interest in and to Your Contributions. | |
**Licenses** |
NewerOlder