Skip to content

Instantly share code, notes, and snippets.

@Izaron
Izaron / XorgMint
Created May 16, 2015 09:58
xorg.conf
# generate modeline with command "cvt 1680 1050" (or the resolution you're looking for)
Section "Device"
Identifier "Configured Video Device"
# Option "ModeValidation" "NoEdidModes"
# Option "UseEdid" "false"
EndSection
Section "Monitor"
Identifier "Configured Monitor"
@Izaron
Izaron / gist:a94df7808e1589223870
Created August 24, 2015 15:27
1680x1050display
xrandr --newmode 1680x1050 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
xrandr --addmode DVI-I-1 1680x1050
xrandr --output DVI-I-1 --mode 1680x1050
@Izaron
Izaron / Main.java
Created September 25, 2015 17:02
Codeforces Statistics
package com.izaron.codeforces.json;
import java.io.*;
import java.net.*;
import java.util.*;
import org.json.*;
import sun.misc.Sort;
// ==UserScript==
// @name AntiMaximan
// @namespace http://codeforces.com/blog/entry/*
// @include http://codeforces.com/blog/entry/*
// @version 1
// @grant none
// ==/UserScript==
$(".avatar:contains('MAXIMAN')").parent().parent().hide();
String generateHtml(String codeTheme, String lineNumbersProperty, String font, String sourceCode) {
if (!lineNumbersProperty.isEmpty()) {
return "<link rel=\"stylesheet\" href=\"styles-hl/" + codeTheme + ".css\">\n" +
"<script src=\"highlight.pack.js\"></script>\n" +
"<script src=\"highlightjs-line-numbers.js\"></script>\n" +
"<script>hljs.initHighlightingOnLoad();</script>\n" +
"<script>hljs.initLineNumbersOnLoad();</script>\n" +
"<link rel=\"stylesheet\" href=\"lines.css\">\n" +
"<style type=\"text/css\">.hljs {\n" +
" font-family: \"" + font + "\";\n" +
@font-face {
font-family: "Andale Mono";
src: url("fonts/andale-mono.ttf")
}
@font-face {
font-family: "Courier New";
src: url("fonts/courier-new.ttf")
}
fun main(args: Array<String>) {
val pairs = (1..readLine()!!.toInt()).map {
val (a, b) = readLine()!!.split(' ').map(String::toInt)
Pair<Int, Int>(Math.min(a, b), Math.max(b, a))
}
print(when {
pairs.all { it.first % 3 == 0 && it.second % 3 == 0 } -> 0 // Has no answers
else -> {
val sum = pairs.sumBy { it.first }
when {
from pysubs2 import *
import sys
def main(argv=sys.argv):
if len(argv) <= 2:
print("Usage: python subtitle-glue.py output-file input-files")
return
subs = SSAFile()
import os
import sys
import subprocess
from termcolor import colored
def make():
print("Building... ", end='')
res = subprocess.Popen('cmake /home/izaron/GCI-Fork1/ccextractor/src && make', shell=True, stdout=subprocess.PIPE)
output = res.communicate()[0]
print(colored("Builded", 'green'))
@Izaron
Izaron / README.TXT
Last active December 13, 2016 19:59
How to use Vagrant with CCExtractor
Install vagrant - choose your version https://www.vagrantup.com/downloads.html
For ubuntu you must download .deb file and simply launch it
Install VirtualBox 5.0 (Newer versions are not supported yet) - https://www.virtualbox.org/wiki/Download_Old_Builds
Choose file for your system. Version VirtualBox 5.0.30 at the top will be OK
Then download CCExtractor and launch vagrant:
$ git clone git@github.com:CCExtractor/ccextractor.git # clone repository
$ cd ccextractor