Skip to content

Instantly share code, notes, and snippets.

View xitij2000's full-sized avatar
🍮
Alive

Kshitij Sobti xitij2000

🍮
Alive
View GitHub Profile
@xitij2000
xitij2000 / tutor-devstack.py
Created August 18, 2023 11:22
tutor-devstack-plugin
import re
from urllib.parse import urlparse
import click
from tutor import hooks
from tutor import config as tutor_config
from tutor.commands.dev import DevContext
GITHUB_PR_REGEX = re.compile(
r"\/(?P[a-z0-9-_]+)\/(?P[a-z0-9-_]+)\/pull\/(?P[0-9]+)"
)
@xitij2000
xitij2000 / xblock-chat-sample.yml
Created September 17, 2020 17:48
Sample Code for XBlock Chat's YAML configuration
- welcome-step:
messages:
- alice: "Hello my name is Alice!"
- bob: "And I am Bob."
- alice: "Today we will ask you a basic trivia question."
- bob: "Would you like to continue?"
responses:
- "Yes": question-step
- "No": exit-step
- question-step:
from pathlib import Path
from babel.messages import pofile
from babel.messages.catalog import Catalog
missing = Catalog("ar")
changed = Catalog("ar")
added = Catalog("ar")
asu_django = pofile.read_po(Path("asu/django.po").open())
edx_django = pofile.read_po(Path("edx/django.po").open())

Keybase proof

I hereby claim:

  • I am xitij2000 on github.
  • I am kshitij_sobti (https://keybase.io/kshitij_sobti) on keybase.
  • I have a public key ASCDSzEM__3x_B4miMNan-U_WpXGxUrYWrxqkaQT19OBigo

To claim this, I am signing this object:

@xitij2000
xitij2000 / linux-game-save-locations
Last active June 27, 2019 15:01
A JSON file with paths to locations for game saves. (Scraped from PC Gaming Wiki)
[{"path": "~/.config/0ad/", "game": "0 A.D."},
{"path": "~/.local/share/aspyr-media/borderlands the pre-sequel/willowgame/", "game": "Borderlands: The Pre-Sequel"},
{"path": "~/Documents/BotaniculaSaves/settings.txt", "game": "Botanicula"},
{"path": "", "game": "Bridge Constructor"},
{"path": "", "game": "Boson X"},
{"path": "", "game": "Breach & Clear"},
{"path": "~/.Braid/", "game": "Braid"},
{"path": "", "game": "Braveland"},
{"path": "~/.local/share/aspyr-media/borderlands 2/willowgame/config/", "game": "Borderlands 2"},
{"path": "~/.BlocksThatMatterUserDatas/", "game": "Blocks That Matter"},
@xitij2000
xitij2000 / edx-dl.py
Created March 9, 2014 20:40
A script to download videos from EdX using aria2 and automatically putting them in a clean folder hierarchy.
# A script that can automatically download videos from Edx
# Currently this is heavily tied to the way my Edx account and my computer is
# set up. It downloads by sending the the download url and download directory
# to aria2 runnig in rpc mode.
# More info here: http://aria2.sourceforge.net/manual/en/html/aria2c.html#rpc-interface
# You can use http://ziahamza.github.io/webui-aria2/ to see download progress
# For now parameters, such as username, password, and which course to download
# can be provided in the script
# I intend to make it more flexible
from __future__ import print_function
@xitij2000
xitij2000 / gist:1447056
Created December 8, 2011 13:56
Dart code to print squares of first 10 numbers.
#import('dart:dom');
class Example {
void run() {
HTMLDocument doc = window.document;
doc.write(square(10));
}
List<int> square(int n) {
var result = new List<int>();
for(int i = 0; i < n; i++) {
result.add(i * i);
@xitij2000
xitij2000 / 10squares.hx.js
Created December 8, 2011 13:52
haXe code to print squares of first 10 numbers.
Main.main = function() {
new Main();
js.Lib.document.write(Main.square(10).join(","));
}
Main.square = function(n) {
var i = 0;
var result = new Array();
{
var _g = i;
while(_g < n) {
@xitij2000
xitij2000 / 10squares.cljs
Created December 8, 2011 13:47
ClojureScript code to print squares of first 10 numbers.
(ns example)
(defn ^:export square [n]
(for [x (range n)]
(* x x)))
(.write js/document
(reduce str
(interpose ","
(square 10))))
@xitij2000
xitij2000 / gist:1447029
Created December 8, 2011 13:43
JavaScript generated from CoffeeScript
var square;
square = function(n) {
var i, _results;
_results = [];
for (i = 1; 1 <= n ? i <= n : i >= n; 1 <= n ? i++ : i--) {
_results.push(i * i);
}
return _results;
};