Skip to content

Instantly share code, notes, and snippets.

@julien-duponchelle
julien-duponchelle / task.md
Last active October 21, 2022 14:32 — forked from dscottie/task.md
Coding Task

Coding Interview - The Task

You need to implement the following user story:

As a user, I want to see the trains that fit my travel schedule, So that I can decide what to buy

Steps

Keybase proof

I hereby claim:

  • I am noplay on github.
  • I am jduponchelle (https://keybase.io/jduponchelle) on keybase.
  • I have a public key ASCtHObJrTdWuSP1SCXAaiBapo-xgYwHqF8LdFNCJYH4qAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am noplay on github.
  • I am jduponchelle (https://keybase.io/jduponchelle) on keybase.
  • I have a public key ASCtHObJrTdWuSP1SCXAaiBapo-xgYwHqF8LdFNCJYH4qAo

To claim this, I am signing this object:

@julien-duponchelle
julien-duponchelle / extractor.py
Created January 12, 2016 16:13
IOS NVRAM extractor
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Bernhard Ehlers, GNS3
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
@julien-duponchelle
julien-duponchelle / upload_file_qt
Created April 29, 2015 20:10
Upload large file with Qt
from PyQt5 import QtCore,QtNetwork
import sys
app = QtCore.QCoreApplication(sys.argv)
f = QtCore.QFile("test.image")
url = QtCore.QUrl("http://localhost:8001/v1/dynamips/vms/test.image")
@julien-duponchelle
julien-duponchelle / qt_migrate.py
Created April 17, 2015 15:01
QT4 to QT5 GNS3 migration
import os
import sys
import re
import inspect
from PyQt5 import QtWidgets
class FilePatcher:
def __init__(self, path):
self._path = path
self._line_number = 1
@julien-duponchelle
julien-duponchelle / pre-commit
Last active September 6, 2016 11:07
Git PEP 8 pre commit hook
#!/bin/bash
echo "Pre-commit started"
echo "PEP 8"
git diff --cached --name-only | grep .py | grep -v old_ | xargs autopep8 --in-place -v --aggressive --aggressive
git diff --cached --name-only | grep .py | grep -v old_ | xargs git add
git diff --cached --name-only | grep .py | grep -v old_ | xargs pep8
if [ $? == 0 ]
#Use current directory as default search scope in Finder
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
#Show Path bar in Finder
defaults write com.apple.finder ShowPathbar -bool true
#Show Status bar in Finder
defaults write com.apple.finder ShowStatusBar -bool true
#Enable AirDrop over Ethernet and on unsupported Macs running Lion
# inspired by http://ariejan.net/2010/08/23/resque-how-to-requeue-failed-jobs
# retry all failed Resque jobs except the ones that have already been retried
# This is, for instance, useful if you have already retried some jobs via the web interface.
Resque::Failure.count.times do |i|
Resque::Failure.requeue(i) unless Resque::Failure.all(i, 1)['retried_at'].present?
end
# retry all :)
Resque::Failure.count.times do |i|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Dump all replication events from a remote mysql server
#
from pymysqlreplication import BinLogStreamReader
import gc