Skip to content

Instantly share code, notes, and snippets.

@ramonsmits
ramonsmits / gist:7563502
Created November 20, 2013 13:52
Example of Mandrill webhook JSON data.
[
{
"event": "send",
"msg": {
"ts": 1365109999,
"subject": "This an example webhook message",
"email": "[email protected]",
"sender": "[email protected]",
"tags": [
"webhook-example"
@deltheil
deltheil / md5deep.sh
Last active October 22, 2016 21:28
Files and directory comparison with md5deep matching mode (see http://md5deep.sourceforge.net/start-md5deep.html#match).
# Create a reference folder with some data
mkdir foo
echo "hey" > foo/A.txt
echo "scm" > foo/B.txt
echo "git" > foo/C.txt
# Generate the list of hashes for each file
# -b = bare mode (strips any leading directory
# information from displayed filenames)
md5deep -b foo/* > hashes.txt
@cyrilmottier
cyrilmottier / AndroidManifest.xml
Last active January 30, 2023 00:04
Android example of how to add a custom logo to the ActionBar and ensure the best possible matching starting Window.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cyrilmottier.android.anapp">
<!-- ... -->
<application
android:icon="@drawable/ic_launcher"
android:label="@string/config_app_name"
android:theme="@style/Theme.AnApp" >
@JakeWharton
JakeWharton / dex.sh
Last active March 25, 2024 13:54
`classes.dex` method count helpers. Requires smali/baksmali from https://code.google.com/p/smali/ and dexdump from the build-tools in the Android SDK be on your PATH.
function dex-method-count() {
cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
}
function dex-method-count-by-package() {
dir=$(mktemp -d -t dex)
baksmali $1 -o $dir
for pkg in `find $dir/* -type d`; do
smali $pkg -o $pkg/classes.dex
count=$(dex-method-count $pkg/classes.dex)
name=$(echo ${pkg:(${#dir} + 1)} | tr '/' '.')
@ju-popov
ju-popov / timestamp.py
Last active April 7, 2021 16:09
Python DateTime / Timestamp Convertion
######################################################################
# CURRENT AWARE LOCAL DATETIME
######################################################################
from datetime import datetime
from tzlocal import get_localzone
local_tz = get_localzone()
local_dt = datetime.now(local_tz)
@tanmaykm
tanmaykm / pywebsock.html
Last active July 25, 2019 09:51
Minimal WebSocket Broadcast Server in Python
<!DOCTYPE html>
<html>
<head>
<title>Websocket Demo</title>
<style>
#messages {
border: dotted 1px #444444;
font: 12px arial,sans-serif;
}
@jjaffeux
jjaffeux / delegation_rubymotion.rb
Last active December 11, 2015 07:08
Event delegation rubymotion example
#example
class Request
attr_accessor :delegate
def self.initWithPath(*args, &block)
instance = allocate
instance.myInitializer(*args, &block)
instance
end
@deltheil
deltheil / mobiledev-wanted.md
Created September 21, 2012 14:10
Moodstocks is looking for a Mobile developer

We are looking for a Lead Mobile Developer to join our core team. Let's be clear: you will be THE mobile guy here at Moodstocks designing, developing and maintaining apps, bindings and plugins on-top of our core scanning SDK.

Mission

We have a lot of stuff to do including:

  • maintaining, documenting and improving the Moodstocks SDK by focusing on the Objective-C and Java / JNI bindings, the Moodstocks Scanner application, the demo app

  • taking our brand-new Qrumble scanning app to the next level,

@catwell
catwell / webdev-wanted.md
Created September 21, 2012 13:12
Moodstocks is looking for a Web developer

We are looking for a lead Web developer. You will make both the front- and back-end of our Web applications.

Mission

Let us be honest: nobody in our team is a real Web developer, so there is a lot to be done. Here are a few examples of projects we have in mind:

  • Our corporate website is a Wordpress blog. This approach has limits, we would like to decouple it from our blog and rewrite it from scratch.

  • Maybe the blog itself could be moved to a static engine, with comments handled by Disqus.

@catwell
catwell / b64url-np.md
Last active September 5, 2024 16:42
Decoding Base64-URL without padding

Decoding Base64-URL without padding

1) Add padding

Divide the length of the input string by 4, take the remainder. If it is 2, add two = characters at the end. If it is 3, add one = character at the end.

You now have Base64-URL with padding.

2) Translate to Base64