Skip to content

Instantly share code, notes, and snippets.

Puneeth Chaganti punchagan

Block or report user

Report or block punchagan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
punchagan / .gitignore
Last active Oct 17, 2019
Whatsapp Broadcast Export to Zulip
View .gitignore
zzgvh /
Created Aug 8, 2018
Alternative project access restriction model
class RestrictedUserProjectsByOrg(models.Model):
user = models.OneToOneField('User', related_name='restricted_projects')
organisation = models.ForeignKey('Organisation', related_name='restricted_users')
is_restricted = models.BooleanField(default=False) #do we need this?
restricted_projects = models.ManyToManyField(
'Project', related_name='inaccessible_by', null=True, blank=True)
Descriptions of events and pseudo code. One question I haven't thought through is multiple employments
by both user and admin
bep /
Last active Feb 9, 2020
Run Hugo on an Android phone

First install Termux

Then there are two options:

Build from source

Open the Termux terminal on your Android device and copy-and-paste the commands listed below and hit ENTER:

alysonla / active-issues.sql
Last active Nov 28, 2019
Queries that power the open source section of the 2016 Octoverse report
View active-issues.sql
-- Active issues
-- Count of total active issues in the specified time frame
-- Source: githubarchive public data set via Google BigQuery
COUNT(DISTINCT JSON_EXTRACT_SCALAR(events.payload, '$')) AS events_issue_count
FROM (SELECT * FROM TABLE_DATE_RANGE([githubarchive:day.],TIMESTAMP('2015-09-01'),TIMESTAMP('2016-08-31')))
AS events
-- 10,723,492 active issues
fperez / ProgrammaticNotebook.ipynb
Last active Feb 10, 2020
Creating an IPython Notebook programatically
View ProgrammaticNotebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
edrex /
Last active Jun 8, 2016
Camlistore on a VPS with S3 blob storage

Let's set up Camlistore on a Linux server, with blobs stored in s3. This seems to be the currently best-supported option for "cloud" deployment.

This is meant as a supplement to the official server config doc. Read through both docs before you start.

This blog post is also recommended reading.

I've posted my config files for reference, but they will be created the first time you run camlistored (for the server) and camput init (for the client) so don't copy them.

lelandbatey /
Last active Feb 12, 2020
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!


This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"


baali /
Last active May 28, 2016
MajorClust algorithm implementation using sklearn based on SO conversation about text clustering using python(
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import linear_kernel
import numpy as np
from itertools import combinations
from random import shuffle
def majorclust_sklearn():
texts = [
"foo blub baz",
"foo bar baz",
zflat /
Last active Nov 29, 2019
Migrate pg dump from Heroku to local sqlite3 development (and beyond)
# Export the Heroku PG database to a local dump file
heroku pgbackups:capture
curl -o latest.dump `heroku pgbackups:url`
# Install postregs & Setup password
# List databases
sudo -u postgres psql -l
hellerbarde / latency.markdown
Created May 31, 2012 — forked from jboner/latency.txt
Latency numbers every programmer should know
View latency.markdown

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns  = 250 µs
You can’t perform that action at this time.