Skip to content

Instantly share code, notes, and snippets.

from opaque_keys import InvalidKeyError
from opaque_keys.edx.location import SlashSeparatedCourseKey
from django import forms
from django.core.exceptions import ValidationError
class UsersInCohortApiListForm(forms.Form):
course_key_string = forms.CharField()
cohort_id = forms.IntegerField()
@lgp171188
lgp171188 / auto-expand-tco-links-on-tweetdeck-website.user.js
Created October 6, 2015 05:47
Auto expand t.co links on Tweetdeck website
@lgp171188
lgp171188 / auto-expand-tco-links-on-twitter.user.js
Last active August 29, 2015 14:21
Auto expand t.co links on Twitter
@lgp171188
lgp171188 / keybase.md
Last active May 6, 2021 09:26
keybase.md

Keybase proof

I hereby claim:

  • I am lgp171188 on github.
  • I am guruprasad (https://keybase.io/guruprasad) on keybase.
  • I have a public key whose fingerprint is 8500 CEE9 CDC8 7AA0 DB4B 1CFC B3FE 257A A7E4 36AA

To claim this, I am signing this object:

@lgp171188
lgp171188 / singleton.cpp
Created August 13, 2014 08:12
Singleton design pattern
#include<iostream>
using namespace std;
class Singleton
{
int x;
Singleton(int v):x(v){ }
Singleton(Singleton const&);
Singleton& operator=(Singleton const&);
public:
@lgp171188
lgp171188 / deep_copy.cpp
Created August 13, 2014 08:10
Illustration of deep copy
#include<iostream>
using namespace std;
class A
{
public:
int x;
A(int v):x(v) {}
};
#include<iostream>
#include<vector>
using namespace std;
class Heap
{
vector<int> array;
public:
Heap() {}
@lgp171188
lgp171188 / linked_list_double_pointer.cpp
Created July 13, 2013 07:55
Linked list operations using double pointers
#include<iostream>
using namespace std;
struct node
{
int data;
node* next;
}*root_node;
bool compare(node* new_node, node* existing_node)