Skip to content

Instantly share code, notes, and snippets.

View ksdme's full-sized avatar
⚔️

Kilari Teja ksdme

⚔️
View GitHub Profile
@ksdme
ksdme / old.py
Last active July 29, 2017 21:37
class ResponseError(Brick):
"""
{
"code": "int()",
"data": "opt(class(ErrorCodes))",
"message": "str()"
}
"""
@ksdme
ksdme / new.py
Last active July 29, 2017 21:36
class ResponseError(Brick):
""" General Response Error """
STRUCT = {
"code": integer(),
"data": opt(klass(ErrorCodes)),
"message": string()
}
@ksdme
ksdme / merge.py
Created September 4, 2017 07:31
A compact one line implementation of merge sort!
def merge_em(slice):
return slice if len(slice) == 1 else (lambda first, secon, buffed: (buffed + secon) if map(lambda _: ([buffed.append(secon.pop(_[0])) if two < _[1] else None for two in secon], buffed.append(_[1])), enumerate(first)) or True else None)(*(map(merge_em, (slice[:int(len(slice)/2)], slice[int(len(slice)/2):])) + [[]]))
print merge_em(map(int, raw_input("Enter Subjects: ").strip().split())), raw_input()
@ksdme
ksdme / inject.html
Created October 9, 2017 23:50
Injects DotSlash's Mascot
<style type="text/css">
.inj-card {
display: block;
position: fixed;
bottom: 30px;
right: 30px;
width: 75px;
height: 75px;
background: red;
@ksdme
ksdme / inject.min.html
Created October 9, 2017 23:51
Injects DotSlash's Mascot
<style type="text/css">.inj-card{display: block;position: fixed;bottom: 30px;right: 30px;width: 75px;height: 75px;background: red;border-radius: 3px;box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);}.inj-image{width: 100%;height: 100%;border-radius: 3px;}</style><div class="inj-card"><img src="https://i.imgur.com/Q3VgoVf.jpg" class="inj-image"></div>
@ksdme
ksdme / slimcoin.conf
Created December 20, 2017 22:08
slimcoin.conf
rpcuser=user
rpcpassword=pass
listen=0
server=1
deamon=1
rpcport=41683
splash=0
reservebalance=1000000
addnode=37.187.100.75:41682
addnode=212.243.7.37:57208
var Trackers = function() {
return [
"wss://tracker.fastcast.nz:443/announce",
"ws://tracker.btsync.cf:2710/announce",
"wss://tracker.openwebtorrent.com:443/announce",
"wss://tracker.btorrent.xyz:443/announce",
"udp://tracker.coppersurfer.tk:6969/announce",
"udp://tracker.leechers-paradise.org:6969/announce",
"udp://9.rarbg.to:2710/announce",
@ksdme
ksdme / coala
Created May 10, 2018 15:42
coala --json output
[nltk_data] Downloading package punkt to /home/ksdme/nltk_data...
[nltk_data] Package punkt is already up-to-date!
[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data] /home/ksdme/nltk_data...
[nltk_data] Package averaged_perceptron_tagger is already up-to-
[nltk_data] date!
{
"results": {
"all": [],
"all.commit": [
@ksdme
ksdme / result-specs-sheet.md
Last active August 3, 2018 07:35 — forked from ravi-ranjan-singh/result-specs-sheet.md
Initial Spec Sheet for results.dotslashcommunity.com.

Spec Sheet v1

This document describes all the planned features for the initial version of the results.dotslashcommunity.com. This is intended to act as a guideline to the UI designer and the overall project. Changes to this doc should only happen with majority consensus from the community.

The recommended features and behavior have been divided into sections and expanded upon below.

  • Search

    • A fixed search bar on the top of the screen for both mobile and desktop versions of the site.
    • Search bar has an accompanying Submit button, pressing which performs the actual search.
    • Search bar accepts only roll numbers.
@ksdme
ksdme / fat-arrow.patch
Created August 30, 2018 08:47
Fat arrow lambda, Python 2.7
diff --git a/Grammar/Grammar b/Grammar/Grammar
index 4c3f33da32..f643cca237 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -86,7 +86,7 @@ testlist_safe: old_test [(',' old_test)+ [',']]
old_test: or_test | old_lambdef
old_lambdef: 'lambda' [varargslist] ':' old_test
-test: or_test ['if' or_test 'else' test] | lambdef
+test: or_test ['if' or_test 'else' test] | short_lambdef | lambdef