Skip to content

Instantly share code, notes, and snippets.

View jineshpaloor's full-sized avatar

Jinesh Panampattakunnath jineshpaloor

View GitHub Profile
@toastdriven
toastdriven / haystack.sh
Created October 9, 2009 05:30
haystack.sh
#!/bin/sh
# First, open up GitX
cd ~/Code/Python/django-haystack; gitx
tmux start-server
tmux new-session -d -s Haystack -n git
tmux new-window -tHaystack:1 -n test
tmux new-window -tHaystack:2 -n solr
tmux new-window -tHaystack:3 -n docs
tmux new-window -tHaystack:4 -n runserver
@mhgrove
mhgrove / CreateReasoningConn.java
Last active March 21, 2017 01:48
Example of how to use Stardog's Reasoning capabilities via SNARL
ReasoningConnection aReasoningConn = ConnectionConfiguration
.to("reasoningExampleTest")
.credentials("admin", "admin")
.reasoning(true)
.connect()
.as(ReasoningConnection.class);
@gcollazo
gcollazo / Backbone.sync_csrftoken.js
Created September 25, 2011 14:56
This is what I did to insert the CSRF token in backbone requests. This works with django.
var oldSync = Backbone.sync;
Backbone.sync = function(method, model, options){
options.beforeSend = function(xhr){
xhr.setRequestHeader('X-CSRFToken', CSRF_TOKEN);
};
return oldSync(method, model, options);
};
@cigrainger
cigrainger / gist:62910e58db46b7397de2
Created July 11, 2014 18:28
Arun et al measure with NPR data
from urllib2 import urlopen
from json import load
import re, nltk
from nltk.stem.wordnet import WordNetLemmatizer
from nltk.corpus import wordnet, stopwords
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s',
level=logging.INFO)
from gensim import corpora, models, similarities, matutils
import numpy as np
@wojteklu
wojteklu / clean_code.md
Last active November 16, 2024 22:03
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules