Skip to content

Instantly share code, notes, and snippets.

@lele85
lele85 / example.html
Created March 25, 2020 08:35
Spreaker Embed on AMPs
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<title>Embed Spreaker</title>
<script async src="https://cdn.ampproject.org/v0.js"></script>
<!-- Import the amp-iframe component in the header. -->
<script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>
<link rel="canonical" href="https://amp.dev/documentation/examples/components/amp-iframe/index.html">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!DOCTYPE html>
<html>
<head>
<title></title>
<script>alert(process)</script>
</head>
<body>
</body>
</html>
@lele85
lele85 / .nvmrc
Created January 30, 2018 13:18
CryptoCheck.js
v8.9.3
import BrowserWindow from "modules/common/lib/BrowserWindow";
const Clipboard = {
copyToClipboard: (text) => {
const browseWin = BrowserWindow.get();
const browserDoc = browseWin.document;
// IE specific
if (browseWin.clipboardData && browseWin.clipboardData.setData) {
browseWin.clipboardData.setData("Text", text);
import Clipboard from "modules/common/lib/Clipboard";
import React from "react";
export class CopyToClipboard extends React.Component {
constructor() {
super();
this.timeout = null;
this.state = {
copying: false,
@lele85
lele85 / Test.js
Created September 29, 2017 08:59
Test reducer with real actions and real store
import {
installJasmineAjax,
uninstallJasmineAjax,
generateApiSuccessResponse
} from "modules/common/lib/TestUtils";
import { episodeAdsFetchReducer } from "modules/episode/reducers/children/episodeAdsFetchReducer";
import {
episodeAdsFetch
} from "modules/episode/actions/episodeAdsFetchActions";
import { createStore, applyMiddleware } from "redux";
@lele85
lele85 / test.js
Last active February 21, 2017 16:40
Currying
import _get from "lodash/get";
import _merge from "lodash/merge";
import _isEqual from "lodash/isEqual";
const not = (fun) => (...args) => !fun(...args);
const and = (fun1, fun2) => (...args) => fun1(...args) && fun2(...args);
const isSaving = (savingStatePath) => (state) => {
const savingState = _get(state, savingStatePath, false);
return savingState && savingState.state === "SAVING";
Verifying that +emanuelerampichini is my blockchain ID. https://onename.com/emanuelerampichini
var express = require("express");
var formidable = require("formidable");
var app = express();
app.post("/help/crashes", function (req, res) {
var form = new formidable.IncomingForm();
form.uploadDir = "./dumps";
form.keepExtensions = true;
form.parse(req, function(error, fields) {
if(!error){
require("crash-reporter").start({
productName: "Electron",
companyName: "Github, Inc.",
submitUrl: "http://127.0.0.1:3000/help/crashes",
autoSubmit: true
});
process.crash();