Skip to content

Instantly share code, notes, and snippets.

@fjahn
fjahn / deletionEndpoint.mjs
Last active November 23, 2023 07:15
Facebook Data Deletion Callback
import crypto from 'crypto'
import parseSignedRequest from './parseSignedRequest.mjs'
import { instance as fileStorage } from '../ConfirmingFileStorage.mjs'
import { getLogger } from '../logger.mjs'
import { toAbsoluteUrl } from '../util.mjs'
const logger = getLogger('deletionEndpoint')
export function registerHandles (app) {
setTimeout(function() {
function getAllModules() {
return new Promise((resolve) => {
const id = _.uniqueId("fakeModule_");
window["webpackJsonp"](
[],
{
[id]: function(module, exports, __webpack_require__) {
resolve(__webpack_require__.c);
}
@Stadicus
Stadicus / setup_clightning.md
Last active December 29, 2022 11:41
Setup c-lightning on Digital Ocean

E-Commerce c-lightning node on Digital Ocean

Prerequisites

  • based on small Digital Ocean VPS (1CPU / 1GB RAM) with Ubuntu 16.04
  • SSH keys are recommended, but not described here
  • (sub) domain name necessary for SSL certificate

UFW & basic stuff

Login as "root"

@tanaikech
tanaikech / submit.md
Last active January 7, 2022 22:58
About Updated Utilities.computeHmacSignature()

About Updated Utilities.computeHmacSignature()

By the Google's update at June 19, 2018, finally, Utilities.computeDigest(), Utilities.computeHmacSha256Signature() and Utilities.computeHmacSignature() got to be able to use the byte arrays. By this, using only native Google Apps Script, the result can be retrieved without using jsSHA. When I used the updated them, the response speed is much faster than that of jsSHA. It is considered that this may be optimized for Google Apps Script. As a sample, it shows 2 samples as follows. The both results are the same.

Sample script 1: Using jsSHA

var obj = new jsSHA("SHA-512", "TEXT");
obj.setHMACKey(key, "B64");
obj.update(value);
var res = obj.getHMAC("B64");
@brainysmurf
brainysmurf / concurrency.gs
Last active February 22, 2024 07:37
Concurrent processing in App Scripts
/**
* Pretends to take a long time to return two rows of data
*
* @param {string} endpoint
* @return {ResponseObject}
*/
function doSomething (endpoint) {
Utilities.sleep(5 * 1000); // sleep for 5 seconds
return {
numberOfRows: 2,
function isChatMessage(message) {
if (message.__x_isSentByMe) {
return false;
}
if (message.__x_isNotification) {
return false;
}
if (!message.__x_isUserCreatedType) {
return false;
}
@tomeraz
tomeraz / ubuntu-remote-debug-ios.md
Last active January 17, 2024 02:14
How to install remote debugging with Chrome dev tools for iOS devices safari on Ubuntu 16.04

install remote debugging with Chrome dev tools for iOS devices safari on Ubuntu 16.04

1. Install linuxbrew (Homebrew) for linux

http://linuxbrew.sh/:

sudo apt-get install build-essential curl file git python-setuptools
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
test -d ~/.linuxbrew && PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"
test -d /home/linuxbrew/.linuxbrew && PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH"
@madpink
madpink / gist:a48289e726f1f7b86ed947db2a62d6e8
Last active April 28, 2023 17:24
Install HAProxy, Certbot/Let's Encrypt for CouchDB
*-*-*-*-*-*-*-*-*-* Updated January 04, 2022 *-*-*-*-*-*-*-*-*-*
### Update and install some utilities
sudo apt update && sudo apt-get upgrade
sudo apt install -y curl apt-transport-https gnupg nano
curl https://couchdb.apache.org/repo/keys.asc | gpg --dearmor | sudo tee /usr/share/keyrings/couchdb-archive-keyring.gpg >/dev/null 2>&1
source /etc/os-release
@anubhavshrimal
anubhavshrimal / CountryCodes.json
Last active May 21, 2024 07:02 — forked from Goles/CountryCodes.json
Country and Dial or Phone codes in JSON format
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"
@nikmartin
nikmartin / twiml.gs
Created November 9, 2015 21:38
Google Apps Script to produce Twilio TWIML
function doGet(e) {
var toNum = e.parameter.PhoneNumber;
var fromNum = e.parameter.CallerId;
var action = e.parameter.Direction;
var record = e.parameter.Record;
Logger.log(e);
var output = ContentService.createTextOutput();
var xml = createDialTWIML(fromNum, toNum, action);