Skip to content

Instantly share code, notes, and snippets.

View karlcow's full-sized avatar
⛩️
Working from … anywhere

Karl Dubost karlcow

⛩️
Working from … anywhere
View GitHub Profile
@karlcow
karlcow / tracking.md
Last active August 29, 2015 14:06
Tracked by redirections from a simple tweet.

How tracking is working.

Let's start a first request.

→ http HEAD http://t.co/b6O9bSv5XO

I wanted to get a way to inspect the value of variables when a function was called without modifying the code. I tested it on a simple function, and it does what I wanted.

--------------------------------------------------------------------------------
date: '2014-07-11T23:59:00+07:00'
doc: <Element {http://www.w3.org/1999/xhtml}html at 0x10c180638>
DATETYPE: 'created'
finddate: string(//__xpp1:time[@class='created']/@datetime)
Returned: '2014-07-11T23:59:00+07:00'

Récapitulatif des mesures proposées

Définir les principes fondant la protection des droits fondamentaux à l’ère du numérique (3.1.)

Le droit sur les données personnelles : un droit à l’autodétermination plutôt qu’un droit de propriété (3.1.1.)*

Proposition n° 1

Concevoir le droit à la protection des données personnelles comme un droit à « l’autodétermination informationnelle », c’est-à-dire le droit de l’individu de décider de la communication et de l’utilisation de ses données à caractère personnel. Inscrire cette conception dans la proposition de règlement relatif à la protection des données à caractère personnel ou, dans l’attente du règlement, dans la loi du 6 janvier 1978.

@karlcow
karlcow / blogpost.md
Created September 9, 2014 05:15
emlx to mbox for MacOSX. The Web site has disappeared so Here the code. http://web.archive.org/web/20130905074537/http://brownjava.org/2007/08/emlx2mboxpy.html

A week or so ago I decided I wanted to get all of my archived mail from Mac OS X's Mail.app into a more readable format. I was a bit surprised to find that ever since 10.4, Mac OS X stores its mail in an Apple-invented format called "EMLX" (well, this is what I'm calling it at least...each mail message is stored in a file that ends in ".emlx"). A very rough sketch of the file format:

  1. The first line of the file (beginning of the document to the first linefeed) is an ASCII-encoded number representing the size of the actual email message in bytes.
  2. Starting with the first byte after the linefeed is the email, exactly N bytes in size where N is the number of bytes specified in #1.
  3. From the end of the email message to the end of the .emlx file is an XML-encoded Apple PList containing metadata about the email message (presumably for spotlight).

I really don't care for the .emlx file format. The only application that's able to read it is Mail.app. Really the only reason for its existence is because Apple w

@karlcow
karlcow / testing.py
Created September 5, 2014 02:12
testing python: Something I do time to time for getting a better understanding of what holds my variables during a quick test.
def blah(foo):
'''some function in the code'''
lol = another_func(foo)
# testing stuff
vartest = lol
'''
type: {0}
methods: {1}
repr: {2}
'''.format(type(vartest), dir(vartest), repr(vartest))

Let's say you want to send files to a program

python pipe_test.py --blah foo.txt bar.txt

AND send files content to a program with a pipe

cat foo.txt bar.txt | python pipe_test.py --blah
@karlcow
karlcow / borne-librairie.md
Created July 8, 2014 15:09
Démarche en librairie

En tant que visiteur d'une librairie (!= bibliothèque),

  • je parcours les rayons avec les ouvrages papier,
  • je peux feuilleter les ouvrages, en lire un passage
  • je vais à la borne pour commander l'ouvrage numérique. Code barre ? Catalogue ?
  • paiement facile (contactless? pièces et billets? Impression ticket à payer à la sortie du magasin)
  • réception sur USB (Modèle : amener ta tasse pour le café)? Achat d'une USB?
  • réception sur ma liseuse ? Comment ? WIFI ?
@karlcow
karlcow / 1-request.http
Last active August 29, 2015 14:02
Requesting NHK news
GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, compress
Host: www.nhknews.jp
User-Agent: Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0
@karlcow
karlcow / stupid-copy-protection.html
Created May 22, 2014 22:27
People trying to put copy protection on their content.
<!-- WP Content Copy Protection script by Rynaldo Stoltz Starts - http://securiilock.com -->
<div align="center"><noscript>
<div style="position:fixed; top:0px; left:0px; z-index:3000; height:100%; width:100%; background-color:#FFFFFF">
<div style="font-family: Tahoma; font-size: 14px; background-color:#FFF000; padding: 10pt;">Please enable your Javascript to see this page as it is meant to appear!</div></div>
</noscript></div>
<script type="text/javascript">
window.onload = function() {
disableSelection(document.body)
@karlcow
karlcow / testingvideo.js
Created May 9, 2014 01:33
and everything else which is not… something in this category, go to hell ;)
deviceCanPlayFlash: function(){
//TODO - for now, return false for IPhone and IPad
try
{
if(
(navigator.userAgent.match(/iPhone/i))
|| (navigator.userAgent.match(/iPod/i))
|| (navigator.userAgent.match(/iPad/i))
|| (navigator.userAgent.match(/android/i))