Skip to content

Instantly share code, notes, and snippets.

View jatindhankhar's full-sized avatar
🎯
">script>js:alert(1)<?script>

Jatin Dhankhar jatindhankhar

🎯
">script>js:alert(1)<?script>
View GitHub Profile
@jatindhankhar
jatindhankhar / jcurl.sh
Last active February 19, 2019 11:35 — forked from cirla/jcurl.sh
Bash function to curl an HTTP JSON API, print the headers, and then print the body formatted using jq
# Bash function to curl an HTTP JSON API, print the headers,
# and then print the body formatted using jq
#
# Example usage: jcurl https://api.github.com/users/cirla
#function jcurl() {
# disable progress bar and print headers to stdout
# response=$(curl -sD - $@)
# split response at the first empty line (ignoring whitespace)
@jatindhankhar
jatindhankhar / has_both_license.txt
Created February 16, 2018 14:58
License extract check for SugarLabs Org post GCI 2018
https://github.com/sugarlabs/numbers.git
https://github.com/sugarlabs/makeymakey.git
https://github.com/sugarlabs/wordcloud.git
https://github.com/sugarlabs/dimensions.git
https://github.com/sugarlabs/portfolio-activity.git
https://github.com/sugarlabs/sugarchess.git
https://github.com/sugarlabs/reflect.git
https://github.com/sugarlabs/sugar-commander.git
https://github.com/sugarlabs/cedit-activity.git
https://github.com/sugarlabs/JS-Shell.git
@jatindhankhar
jatindhankhar / has_both_license.txt
Created February 15, 2018 17:30
SugarLab Activities License Analysis, post GCI. Great work by GCI students 👏
https://github.com/sugar-activities/4051-activity.git
https://github.com/sugar-activities/4674-activity.git
https://github.com/sugar-activities/4274-activity.git
https://github.com/sugar-activities/4323-activity.git
https://github.com/sugar-activities/4536-activity.git
https://github.com/sugar-activities/4675-activity.git
https://github.com/sugar-activities/4746-activity.git
https://github.com/sugar-activities/4722-activity.git
https://github.com/sugar-activities/4484-activity.git
https://github.com/sugar-activities/4752-activity.git
@jatindhankhar
jatindhankhar / list.txt
Last active August 21, 2017 18:43
Sources of Activities
[ID] : [Source Url]
4027 : https://github.com/sugarlabs/turtleart-activity
4028 : https://github.com/sugarlabs/read-activity
4032 : https://github.com/sugarlabs/imageviewer-activity
4038 : https://github.com/sugarlabs/speak
4041 : https://github.com/sugarlabs/Pippy
4043 : https://github.com/sugarlabs/terminal-activity
4045 : https://github.com/sugarlabs/jukebox-activity
4046 : https://github.com/sugarlabs/jigsaw-puzzle-branch
4054 : http://git.sugarlabs.org/projects/jigsaw-puzzle-branch
@jatindhankhar
jatindhankhar / has_both_license.txt
Last active July 27, 2017 14:55
Modified script for analyzing Sugarlabs activities
https://github.com/sugar-activities/4051-activity.git
https://github.com/sugar-activities/4674-activity.git
https://github.com/sugar-activities/4274-activity.git
https://github.com/sugar-activities/4323-activity.git
https://github.com/sugar-activities/4536-activity.git
https://github.com/sugar-activities/4675-activity.git
https://github.com/sugar-activities/4746-activity.git
https://github.com/sugar-activities/4722-activity.git
https://github.com/sugar-activities/4484-activity.git
https://github.com/sugar-activities/4752-activity.git
@jatindhankhar
jatindhankhar / has_both_license.txt
Created July 19, 2017 07:10
Script to check for License in Sugar-activities
https://github.com/sugar-activities/4051-activity.git
https://github.com/sugar-activities/4674-activity.git
https://github.com/sugar-activities/4274-activity.git
https://github.com/sugar-activities/4323-activity.git
https://github.com/sugar-activities/4536-activity.git
https://github.com/sugar-activities/4675-activity.git
https://github.com/sugar-activities/4746-activity.git
https://github.com/sugar-activities/4722-activity.git
https://github.com/sugar-activities/4484-activity.git
https://github.com/sugar-activities/4752-activity.git
from polib import pofile
from glob import glob
import os
from pprint import pprint
translations = {}
def get_language_code(filepath):
basename = os.path.basename(filepath)
return os.path.splitext(basename)[0]
@jatindhankhar
jatindhankhar / activities.json
Last active May 4, 2017 14:32
Downloads sugar bundles by reading them from a json file. Requires jq to be installed
{"license": "GPLv3+", "description": " There are 4 spaces per row in which you can place a different color, you have ten opportunities to find the correct position of each color.", "name": "Mastermind", "bundle": "mastermind-1.xo", "summary": "Mastermind game for sugar! Drag and drop the colors in correct places for win. ", "directory": "4797", "icon": "activity-mastermind.svg", "developer": "cristian"}
{"description": "Abacus lets the learner explore different representations of numbers using different mechanical counting systems developed by the ancient Romans and Chinese. There are several different variants available for exploration: a suanpan, the traditional Chinese abacus with 2 beads on top and 5 beads below; a soroban, the traditional Japanese abacus with 1 bead on top and 4 beads below; the schety, the traditional Russian abacus, with 10 beads per column, with the exception of one column with just 4 beads used for counting in fourths; and the nepohualtzintzin, the traditional Mayan abacus, with 3 be
@jatindhankhar
jatindhankhar / bfs.cpp
Last active February 23, 2022 22:26
Simple BFS implementation in modern C++
//Modified version of http://www.geeksforgeeks.org/breadth-first-traversal-for-a-graph/
# include <iostream>
# include <algorithm>
# include <vector>
# include <list>
using namespace std;
class Graph
{
# include <bits/stdc++.h>
using namespace std;
//template<typename T>
void print_power_set(const auto &vec,int n)
{ int sum = 0;
long int power_size = (1 << n);
for(long int counter=1; counter < power_size ; counter++)
{
vector<int> subset;
for(int j=0;j<n;j++)