This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem first arg: path to serve | |
rem second arg: port to use | |
docker run -it --rm -p %2:80 -v %1:/usr/share/nginx/html jrelva/nginx-autoindex:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <functional> | |
#include <vld.h> | |
using namespace std; | |
template <typename T> | |
struct Node { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def breakNumber(n): | |
return [(n / 1000) % 10, | |
(n / 100) % 10, | |
(n / 10) % 10, | |
n % 10] | |
def allDifferent(bn): | |
def iter(num, idx): | |
if idx == 4: return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Script simplu pentru facut copii de rezerva | |
# | |
# argument 1: subdirectorul din /media unde facem backup | |
# | |
# restul argumentelor: subdirectoare de backup-uit | |
# Exemplu de desktop entry (cu numele backup.desktop, de plasat in | |
# ~/Desktop; presupune ca scriptul curent este in ~/bin si ca vrem sa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias xterm='xterm -fg black -bg lightyellow -fn 10x20 -fb 10x20' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; for floats, sb-kernel:single-float-bits, sb-kernel:make-single-float | |
;; etc. | |
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(defun mkstr (&rest args) | |
(format nil "~{~a~}" args)) | |
(defun mksymb (&rest args) | |
(intern (apply #'mkstr args)))) | |
(defmacro signed-unsigned-convertors (size) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defpsmacro tefun (name args &body body) | |
(let ((traced-name (gensym (symbol-name name)))) | |
`(progn | |
(defun ,traced-name ,args | |
,@body) | |
(defun ,name ,args | |
(trace (+ "entering " | |
,(encode-js-identifier (symbol-name name)) | |
"(" | |
,@(mapcar #'(lambda (name val) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let ((cache (make-hash-table :test 'equal))) | |
(defun encode-js-identifier (identifier) | |
"Given a string, produces to a valid JavaScript identifier by | |
following transformation heuristics case conversion. For example, | |
paren-script becomes parenScript, *some-global* becomes SOMEGLOBAL." | |
(setf identifier (string-downcase identifier)) | |
(or (gethash identifier cache) | |
(setf (gethash identifier cache) | |
(let ((no-case-conversion nil) | |
(lowercase t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import re | |
import math | |
import os.path | |
class SrtEntry(object): | |
def __init__(self, number, startTime, endTime, text): | |
self.number = number | |
self.startTime = startTime | |
self.endTime = endTime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tries to fix a srt file to match the sub time with the actual dialog time. | |
# Inputs: | |
# - the srt file | |
# - a list of (srt time, spoken dialog time) pairs that will be used | |
# to infer the parameters for the srt time adjustment | |
# Outputs: | |
# - the corrected srt file to standard output | |
# - the correction parameters to standard error | |
import sys |
NewerOlder