Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View caiiiycuk's full-sized avatar

Alexander Guryanov caiiiycuk

View GitHub Profile
@caiiiycuk
caiiiycuk / XitrumTest
Created July 24, 2013 03:43
Scala bug SI-6240
import scala.reflect.runtime.universe._
object ParamAccess {
val typeString = typeOf[String]
}
class ParamAccess {
import ParamAccess._
def paramo[T: TypeTag](key: String, coll: Map[String, Seq[String]]): Option[T] = {
val x = Iterator.from(0).takeWhile(_ <= 10)
val y = Iterator.from(0).takeWhile(_ <= 10)
val xy = y.flatMap { y => x.map { x => (x, y) } }
xy.foreach(println)
@caiiiycuk
caiiiycuk / find_old_files.py
Created August 23, 2018 21:35
Python 2, 3: Find and delete files last modified over than year ago
import os
import time
import sys
src = os.getcwd()
oneyear = 365 * 24 * 60 * 60
totalsaved = 0
with open('old_files.sh', 'w') as f:
for root, dirs, files in os.walk(src):