Skip to content

Instantly share code, notes, and snippets.

View dirtyhenry's full-sized avatar

Mick F dirtyhenry

View GitHub Profile
@dirtyhenry
dirtyhenry / appannie_histogram.R
Created September 14, 2016 17:39
R Script to get a plot of weekly/monthly downloads aggregations from App Annie files.
#
# appannie_histogram.R
#
# Create weekly and monthly aggregations bar plots of your downloads
# from AppAnnie CSV files.
#
# Improvements:
#
# * First and last week of years can have much less than 7 days and create false
# decreases of downloads.
@dirtyhenry
dirtyhenry / test.css
Created November 16, 2015 13:53
Temp.css
body {
background-color: red;
}
@dirtyhenry
dirtyhenry / linear-optimization.rb
Created August 5, 2015 15:19
MITx 15.071x - Unit 8 - Linear Optimization - Radiation Therapy: An Application of Linear Optimization
# Unit 8 of the Analytics Edge
#
# Minimize :
# z = (1 + 2) * X1 + (2 + 2.5) * X2 + 2.5 * X3 + X4 + 2 * X5 + (1 + 2 + 1) * X6
#
# Beamlet
# 1 - 1 2 2 0 0 0 0 0 0
# 2 - 0 0 0 1 2 2.5 0 0 0
# 3 - 0 0 0 0 0 0 1.5 1.5 2.5
# 4 - 1 0 0 2 0 0 1 0 0
@dirtyhenry
dirtyhenry / timezones.txt
Created May 31, 2015 13:09
iOS 8 Known Time Zones
# #ifdef DEBUG
# NSArray *timeZones = [NSTimeZone knownTimeZoneNames];
# for(NSString *timeZone in timeZones) {
# DDLogDebug(@"%@", timeZone);
# }
# #endif
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
@dirtyhenry
dirtyhenry / .bowerrc
Last active August 29, 2015 14:13
The Rails' Bootstrap
{
"directory": "vendor/assets/components"
}
@dirtyhenry
dirtyhenry / random-bug.html
Last active August 29, 2015 14:12
Deezer SDK : random loss of the current_track event
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://cdn-files.deezer.com/js/min/dz.js"></script>
<style type="text/css">
@dirtyhenry
dirtyhenry / SmackAPITest.java
Created January 14, 2014 14:58
Fooling around the Smack API (a unit test + a POM to get the dependencies)
package com.bootstragram.xmpp;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import junit.framework.TestCase;
@dirtyhenry
dirtyhenry / SELECT.sql
Last active January 2, 2016 09:08
Spam identification for SPIP 3
SELECT auteur, email_auteur, LEFT(texte, 50)
FROM spip_forum
WHERE LEFT(texte, 20) LIKE '%http%'
AND statut <> 'spam'
ORDER BY maj DESC;
@dirtyhenry
dirtyhenry / gist:7547064
Created November 19, 2013 15:27
iOS code that: 1/ validates an email found in a UITextField 2/ check chances of spelling mistakes
- (NSArray *)allMyContacts {
// cf. http://stackoverflow.com/questions/12083643/how-do-i-correctly-use-abaddressbookcreatewithoptions-method-in-ios-6
CFErrorRef error = nil;
ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, &error);
__block BOOL accessGranted = NO;
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) {
accessGranted = granted;
@dirtyhenry
dirtyhenry / bootstragram-dark.terminal
Created October 28, 2013 13:54
My Terminal configurations
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGHyBYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKUHCBEVHFUkbnVsbNQJCgsMDQ4PEFdOU1doaXRlXE5TQ29sb3JTcGFjZV8QEk5T
Q3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NCMAAQA4ACgATSEgwTFFROU0lEEAKAA9IWFxgZ
WiRjbGFzc25hbWVYJGNsYXNzZXNcTlNDb2xvclNwYWNlohobXE5TQ29sb3JTcGFjZVhO