Skip to content

Instantly share code, notes, and snippets.

@eladnava
eladnava / server.js
Created Nov 13, 2020
Get Facebook Ads Lead Notifications in Realtime with Node.js
View server.js
const axios = require('axios');
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const port = 3000;
// Enter the Page Access Token from the previous step
const FACEBOOK_PAGE_ACCESS_TOKEN = '_______________________________';
View export-fat-swift-dynamic-framework.sh
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
@eladnava
eladnava / private.xml
Last active Sep 5, 2016
Karabiner private.xml for volume and music playback controls using F13 - F19 keys on wired Apple Keyboard
View private.xml
<?xml version="1.0"?>
<root>
<item>
<name>F19 to Sleep</name>
<identifier>Sleep</identifier>
<autogen>
__KeyToKey__
KeyCode::F19,
KeyCode::VK_CONSUMERKEY_EJECT, ModifierFlag::OPTION_L | ModifierFlag::COMMAND_L
</autogen>
@eladnava
eladnava / mongodb-s3-backup.sh
Last active Jun 15, 2021
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
View mongodb-s3-backup.sh
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh