Skip to content

Instantly share code, notes, and snippets.

View avamsi's full-sized avatar

Vamsi Avula avamsi

View GitHub Profile
@avamsi
avamsi / custom.css
Last active July 11, 2016 18:42
Quick Tabs' custom CSS
* {
font-family: open sans !important;
}
.qs_input {
font-size: 1em !important;
}
.withfocus:hover,
.withfocus:hover div.title,
[
/* @ EMPTY WINDOW
* Style for empty (no tabs) window
========================================================================= */
{
"class": "sheet_container_control",
"layer0.tint": [26, 29, 35],
"layer0.opacity": 1.0
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>PlasticCodeWrap</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
from collections import defaultdict
import heapq
m, n = map(int, raw_input().split())
grid = [map(int, raw_input().split()) for _ in xrange(m)]
d = defaultdict(lambda: defaultdict(lambda: float('inf')))
for row in xrange(m):
for i in xrange(n):
for j in xrange(i + 1, n):
@echo off & python -x %0 & goto :EOF
import subprocess
import os
IPs = []
for i in os.popen('ipconfig'):
i = i.strip()
if i.startswith('IP'):
IPs.append(i.rsplit(' ', 1)[-1])
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/User/Flatland (SpaceGray Edit).tmTheme",
"copy_with_empty_selection": false,
"default_line_ending": "unix",
"dpi_scale": 1,
"enable_tab_scrolling": false,
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
@avamsi
avamsi / mhp.py
Last active March 19, 2016 02:07
import random
objs = [0, 0, 1]
wins = 0
TIMES = 10**4
for _ in xrange(TIMES):
random.shuffle(objs)
wins += random.choice(objs)
[
{ "keys": ["ctrl+alt+p"], "command": "prompt_select_workspace" },
{ "keys": ["ctrl+shift+s"], "command": "save" },
{ "keys": ["ctrl+shift+v"], "command": "paste_from_history" },
{ "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
{ "keys": ["shift+f7"], "command": "build", "args": {"select": true} },
from itertools import chain, combinations, permutations, product
class CB(object):
def __init__(self):
self.all = list(chain(*[permutations(i) for i in combinations(xrange(10), 4)]))
self.seq = None
self.cab = None
self.cabs = [(i, j) for i, j in product(xrange(5), xrange(5)) if i + j <= 4]
self.cabs.remove((3, 1))
for t in xrange(1, int(raw_input()) + 1):
n, q = map(int, raw_input().split())
qs = [map(int, raw_input().split()) for _ in xrange(q)]
print 'Scenario #%s:' % t
ref = [0] * (n + 1)
for a, b in qs:
if ref[a] >= ref[b] > 0:
if ref[a] != ref[b]:
print 'Suspicious bugs found!'
break