Skip to content

Instantly share code, notes, and snippets.

View ernestjumbe's full-sized avatar

Ernest Jumbe ernestjumbe

View GitHub Profile
As i had a hard time finding anything in the mailchimp documentation, i thought it might help a lost soul to put this info here:
If you cannot find your marketing_permission_id of your mailchimp list (eg. for GDPR compliance), you can do a signup request (maybe others too),
using the API, and it will return its data, including the marketing_permissions array containing the unique id for the opt-in.
POST:
{
"email_address": "[email protected]",
"status": "subscribed",
"status_if_new": "subscribed",
"merge_fields": {
"FNAME": "John",
@jpalala
jpalala / Generated Javascript file
Created October 16, 2017 06:36 — forked from bertt/Generated Javascript file
TypeScript and JQuery sample
var Person = (function () {
function Person(name) {
this.name = name;
}
return Person;
})();
function greeter(person) {
return "hallo " + person.name;
}
var person = new Person("bert");
@husa
husa / pre-commit.sh
Created September 8, 2015 14:39
Git pre-commit hook to run JS Unit Test before every commit
#!/bin/sh
red="\033[0;31m"
yellow="\033[1;33m"
green="\033[1;32m"
reset="\033[0m"
read -a changed_files <<< $(git diff --cached --name-only --raw)
# check if there're any JS related files in commit
runTests=false
@pitpit
pitpit / mailcatcher-install.md
Last active November 21, 2022 04:45
Install Mailcatcher on OSX - works well with macOS Sierra High 10.12.X

05/25/2018: tested with macOS Sierra High 10.12.6

08/04/2020: added @mayesa's suggestion to fix an exception with EventMachine 08/04/2020: tested with macOS Catalina 10.15.5

Install MailCatcher:

brew install ruby
sudo gem install mailcatcher
@tzangms
tzangms / fabfile.py
Created January 14, 2015 10:49
my fabfile example
import os.path
from fabric.api import run, env, put
from fabric.context_managers import cd
from fabric.api import local
from datetime import datetime
from cuisine import *
ROOT_PATH = os.path.dirname(__file__)
@kmaida
kmaida / dynamicPagRepeatAngular.html
Last active December 13, 2023 14:37
AngularJS - Dynamic pagination on ng-repeat with search/filtering. Use with ui.bootstrap
<!DOCTYPE HTML>
<html lang="en" ng-app="myApp">
<head>
<meta charset="utf-8">
<title>Dynamic Pagination w/ Filtering</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Kim Maida">
<!-- JS Libraries -->
@revolunet
revolunet / social.py
Last active January 14, 2021 05:58
Sample custom pipeline for django-social-auth and Facebook backend. Goal is to ask more info to the user before creating the account and the related Customer model.
# settings.py
FACEBOOK_EXTENDED_PERMISSIONS = ['email', 'user_birthday', 'user_location']
SOCIAL_AUTH_PIPELINE = (
'social_auth.backends.pipeline.social.social_auth_user',
'social_auth.backends.pipeline.user.get_username',
'social_auth.backends.pipeline.misc.save_status_to_session',
'web.facebook.check_registered',
'social_auth.backends.pipeline.user.create_user',
'web.facebook.check_profile',
'social_auth.backends.pipeline.social.associate_user',
@solar
solar / install.sh
Created November 5, 2012 16:37
install memcached from source with supervisord
#!/bin/sh
version="1.4.15"
priority="10415"
libevent="/usr/local/libevent/2.0.20-stable/"
supervisordir="/etc/supervisord.d"
# create user
sudo groupadd memcached
sudo useradd -r -g memcached -s /sbin/nologin -M -d /var/run/memcached memcached

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@mrbongiolo
mrbongiolo / fql_query_page_photos.fql
Last active June 22, 2016 19:44
Query for FQL to get all photos from a Facebook Page albums and all photos tagged with that Facebook Page
# Formatted for readability
SELECT src, src_height, src_width, src_small, src_small_height, src_small_width
FROM photo
WHERE pid IN (SELECT pid
FROM photo_tag
WHERE subject='243117879034102' )
OR
pid IN (SELECT pid
FROM photo
WHERE aid IN (SELECT aid