Skip to content

Instantly share code, notes, and snippets.

View Vanuan's full-sized avatar

John Yani Vanuan

  • Lohika
  • Odesa, Ukraine
View GitHub Profile
@Vanuan
Vanuan / etcX11xorg.conf
Created August 24, 2011 19:58
xorg.conf.nvidia
Section "DRI"
Mode 0666
EndSection
Section "ServerLayout"
Identifier "Layout0"
Screen "Screen0"
Option "AutoAddDevices" "false"
EndSection
@Vanuan
Vanuan / xorg8.log
Created August 24, 2011 20:00
xorg8.log
[ 1338.283]
X.Org X Server 1.10.1
Release Date: 2011-04-15
[ 1338.283] X Protocol Version 11, Revision 0
[ 1338.283] Build Operating System: Linux 2.6.24-28-server x86_64 Ubuntu
[ 1338.283] Current Operating System: Linux LordDaret 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64
[ 1338.283] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-2.6.38-8-generic root=UUID=6ff58b14-964a-48f0-8f41-2da357bd4ca9 ro splash vga=769 quiet splash nomodeset nouveau.modeset=0 vt.handoff=7
[ 1338.283] Build Date: 11 August 2011 03:43:05PM
[ 1338.283] xorg-server 2:1.10.1-1ubuntu1.2 (For technical support please see http://www.ubuntu.com/support)
[ 1338.283] Current version of pixman: 0.20.2
@Vanuan
Vanuan / gist:2127207
Created March 19, 2012 21:24
Rails bug
time ruby -Itest test/unit/table_test.rb
Loaded suite test/unit/table_test
Started
E.
Finished in 0.180404 seconds.
1) Error:
test_validation(TableChildTest):
ActiveRecord::RecordInvalid: Validation failed: Percentage is not included in the list
/var/lib/gems/1.9.1/gems/activerecord-3.2.2/lib/active_record/validations.rb:56:in `save!'
@Vanuan
Vanuan / gist:2867670
Created June 4, 2012 10:35
railties tests failing
.....[[:options, []], [:puke, [ApplicationTests::AssetsTest, "test_assets_are_concatenated_when_debug_is_off_and_compile_is_off_either_if_debug_assets_param_is_provided", #<MiniTest::Assertion: Expected /<script src="\/assets\/application-([0-z]+)\.js" type="text\/javascript"><\/script>/ to match "<!DOCTYPE html>\n<html>\n<head>\n <title>We're sorry, but something went wrong (500)</title>\n <style type=\"text/css\">\n body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }\n div.dialog {\n width: 25em;\n padding: 0 4em;\n margin: 4em auto 0 auto;\n border: 1px solid #ccc;\n border-right-color: #999;\n border-bottom-color: #999;\n }\n h1 { font-size: 100%; color: #f00; line-height: 1.5em; }\n </style>\n</head>\n\n<body>\n <!-- This file lives in public/500.html -->\n <div class=\"dialog\">\n <h1>We're sorry, but something went wrong.</h1>\n </div>\n</body>\n</html>\n".>]]][[:options, []], [:puke, [ApplicationTests::Ass
@Vanuan
Vanuan / gist:3907142
Created October 17, 2012 18:16
JSDT type inference
/** @returns {HTMLAnchorElement} */
var link = document.createElement('a');
link.innerHTML = "";
/**
results in the following outline:
class link {
static innerHtml : String
}
@Vanuan
Vanuan / Wrapper.java
Created October 26, 2012 17:14 — forked from vkravets/JythonNailgun.java
Running jython via Nailgun server
package com.github.vanuan.jython.nailgun;
import java.util.Arrays;
import org.python.core.Py;
import org.python.core.PyList;
import org.python.core.PySystemState;
import org.python.core.PyType;
import org.python.util.PythonInterpreter;
#include <gdk/gdkx.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <iostream>
/**
g++ -g `pkg-config gtk+-2.0 --cflags` -c get_wm_name.cpp
g++ get_wm_name.o `pkg-config gtk+-2.0 --libs`
**/
@Vanuan
Vanuan / chrome_bug.html
Last active December 17, 2015 14:09
Behaviour is different in Chrome 25 and Chrome 28
<html>
<head>
<style>
.third {
background:lightgray;
width: 33.3333%;
display: inline-block;
}
.limiter {
width: 290px;
import sys, ast
def printAst(ast, indent=' ', stream=sys.stdout, initlevel=0):
"Pretty-print an AST to the given output stream."
print_node(ast, initlevel, indent, stream.write)
stream.write('\n')
def print_node(node, level, indent, write):
"Recurse through a node, pretty-printing it."
pfx = indent * level
@Vanuan
Vanuan / astPrinter.py
Created July 30, 2013 16:16
Print Python AST
import sys, ast
def printAst(ast, indent=' ', stream=sys.stdout, initlevel=0):
"Pretty-print an AST to the given output stream."
print_node(ast, initlevel, indent, stream.write)
stream.write('\n')
def print_node(node, level, indent, write):
"Recurse through a node, pretty-printing it."
pfx = indent * level