Skip to content

Instantly share code, notes, and snippets.

View Abdelkrim's full-sized avatar

Abdelkrim from Brussels Abdelkrim

View GitHub Profile
@chipoglesby
chipoglesby / bigQueryMailChimp.gs
Last active November 18, 2019 12:38
This gist shows how to query the MailChimp API using Google Apps Script and pushes data to Google BigQuery
// This script is designed to run on a 1 hour trigger in Google Apps Script. It is also written to "WRITE_TRUNCATE" your table
// which means it deletes the table and updates it with the newest information. You can change the variables in campaignList
// if you want to adjust it for your needs.
function chimpyAPI30days() {
projectId = "xxx";
datasetId = "xxx";
tableId = 'xxx';
yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 29);
@aemonge
aemonge / prepare-commit-msg
Last active March 1, 2024 01:02
Angular Commit Message Conventions git hook, so you got your commit prepared to with the messages they expect ;)
#!/bin/bash
firstLine=`head -2 $1 | tail -1`
if [[ $firstLine == \#* ]]; then # Testing that the file starts with a comment, not yet a real commit ;)
echo '<type>(<component>): <subject>' > .prepare-commit-msg-temp
echo '' >> .prepare-commit-msg-temp
echo '<body>' >> .prepare-commit-msg-temp
echo '' >> .prepare-commit-msg-temp
echo '# types: feat, fix, docs, style, refactor, test, chore(mantean)' >> .prepare-commit-msg-temp
@beng
beng / autolog.py
Last active April 3, 2023 16:28 — forked from brendano/autolog.py
modified from the original to remove the use of global variables, implement a logging class instead of relying on sys.stdout, remove the function log decorator, remove the module log decorator, allow color changing on any log call, allow indentation level changing on any log call, and PEP-8 formatting.
# Written by Brendan O'Connor, brenocon@gmail.com, www.anyall.org
# * Originally written Aug. 2005
# * Posted to gist.github.com/16173 on Oct. 2008
# Copyright (c) 2003-2006 Open Source Applications Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@onlinemad
onlinemad / init.js
Last active December 21, 2015 22:18
Init a new project based on bootstrap3-jade-node-express-grunt (https://github.com/ALT-F1/bootstrap3-jade-node-express-grunt)
#!/usr/bin/env node
var https = require('https'),
fs = require('fs'),
AdmZip = require('adm-zip'),
request = require('request'),
prompt = require('prompt'),
util = require('util'),
beautify = require('js-beautify').js_beautify;
@taf2
taf2 / reconnect-on-disconnect.js
Created July 1, 2011 15:51
mongoose node.js reconnect code
var mongoose = require('mongoose');
var db = mongoose.connect("mongodb://localhost/testdb");
var reconnTimer = null;
function tryReconnect() {
reconnTimer = null;
console.log("try to connect: %d", mongoose.connection.readyState);
db = mongoose.connect("mongodb://localhost/testdb");
}
@darktable
darktable / app.yaml
Created March 16, 2011 19:10
GAE: App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be neces
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
@hugs
hugs / COPYING
Created November 21, 2009 23:00
Screentest Demo
Copyright (c) 2009 Jason R. Huggins
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions: