Skip to content

Instantly share code, notes, and snippets.

@zupo
zupo / folder_splitter.py
Created June 24, 2013 12:56
Split a folder with many files into subfolders with N files. Usage: python folder_splitter.py path/to/target/folder
# -*- coding: utf-8 -*-
# @author: Peter Lamut
import argparse
import os
import shutil
N = 10 # the number of files in seach subfolder folder
@hofmannsven
hofmannsven / README.md
Last active July 16, 2024 01:30
Git CLI Cheatsheet
@SeanPlusPlus
SeanPlusPlus / elevator_saga_01.js
Created January 28, 2015 22:53
Elevator Saga Challenge 1
// http://play.elevatorsaga.com/#challenge=1
{
init: function(elevators, floors) {
var elevator = elevators[0]; // Let's use the first elevator
elevator.on("idle", function() {
// The elevator is idle, so let's go to all the floors (or did we forget one?)
elevator.goToFloor(0);
elevator.goToFloor(1);
elevator.goToFloor(2);
#setup some basic python script to get params from the command line
import sys
Param1 = sys.argv[0] #make the first param map to variable Param1
Param2 = sys.argv[1] #make the first param map to variable Param2
# now the google example
# from google api https://developers.google.com/drive/web/manage-downloads#examples
from apiclient import errors
# ...
#!/usr/bin/env python
import collections
def main():
di = {}
f = file('in.txt', 'r')
for line in f:
k = line.rstrip().split(',')[0]
v = line.rstrip().split(',')[1]