Skip to content

Instantly share code, notes, and snippets.

View nishad's full-sized avatar
🐢
I may be slow to respond.

Nishad Thalhath nishad

🐢
I may be slow to respond.
View GitHub Profile
@nishad
nishad / csv2xml.py
Created July 6, 2018 03:49 — forked from justinvw/csv2xml.py
Simple script to convert a CSV file to XML
#!/usr/bin/env python
# encoding: utf-8
"""
csv2xml.py
Created by Justin van Wees on 2011-04-18.
"""
import sys
import os
import string
@nishad
nishad / menu.html
Created June 14, 2018 14:15 — forked from marklindhout/menu.html
A simple yet smooth full-fledged jQuery dropdown menu that works across all modern browsers.
<nav id="access">
<ul class="menu">
<li><a href="#">Home</a></li>
<li><a href="#">Page 1</a>
<ul class="sub-menu">
<li><a href="#">Page 1.1</a></li>
<li><a href="#">Page 1.2</a></li>
<li><a href="#">Page 1.3</a></li>
<li><a href="#">Page 1.4</a></li>
<li><a href="#">Page 1.5</a></li>
@nishad
nishad / gist:cab901cf80b90ebe94133d45512a29fb
Created May 21, 2018 07:20 — forked from phillipsm/gist:0ed98b2585f0ada5a769
Example of parsing a table using BeautifulSoup and requests in Python
import requests
from bs4 import BeautifulSoup
# We've now imported the two packages that will do the heavy lifting
# for us, reqeusts and BeautifulSoup
# Let's put the URL of the page we want to scrape in a variable
# so that our code down below can be a little cleaner
url_to_scrape = 'http://apps2.polkcountyiowa.gov/inmatesontheweb/'
@nishad
nishad / run-fuseki.sh
Created May 11, 2018 10:45
Simple startup script for Apache Jena Fuseki
export JENA_FUSEKI_VERSION=3.7.0
export JENA_HOME=~/opt/apache-$JENA_FUSEKI_VERSION
export FUSEKI_HOME=~/opt/apache-jena-fuseki-$JENA_FUSEKI_VERSION
export FUSEKI_BASE=~/opt/apache-jena-fuseki-$JENA_FUSEKI_VERSION
export JENA_BASE=~/opt/apache-jena-$JENA_FUSEKI_VERSION
export JENA=~/opt/apache-jena-$JENA_FUSEKI_VERSION
export FUSEKI=~/opt/apache-jena-$JENA_FUSEKI_VERSION
export FUSEKIROOT=~/opt/apache-jena-fuseki-$JENA_FUSEKI_VERSION
export JENAROOT=~/opt/apache-jena-$JENA_FUSEKI_VERSION
@nishad
nishad / remove-stopwords.py
Created April 27, 2018 08:50 — forked from acrymble/remove-stopwords.py
Python Remove Stopwords
# Given a list of words, remove any that are
# in a list of stop words.
def removeStopwords(wordlist, stopwords):
return [w for w in wordlist if w not in stopwords]
@nishad
nishad / pep8_cheatsheet.py
Created April 26, 2018 06:29 — forked from RichardBronosky/pep8_cheatsheet.py
PEP-8 cheatsheet
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py
@nishad
nishad / setup.md
Created February 15, 2018 07:36 — forked from nichtich/setup.md
Getting started with Fuseki

Tested with a fresh Ubuntu 16.04.1 LTS

Install Java

$ sudo apt-get install default-jre

Download and install Fuseki with a dedicated user account

@nishad
nishad / dbtest.php
Created January 30, 2018 04:33 — forked from johnlane/dbtest.php
PHP SQLite test script
<?php //origin: http://www.if-not-true-then-false.com/2012/php-pdo-sqlite3-example/
// Kludges
const SQLITE3_TEXT = PDO::PARAM_STR;
const SQLITE3_INTEGER = PDO::PARAM_INT;
// Set default timezone
date_default_timezone_set('UTC');
try {
@nishad
nishad / download_my_podcasts.py
Created February 8, 2017 01:28 — forked from janetriley/download_my_podcasts.py
A Python script to download podcasts from an xml feed and tag the MP3s.
"""
A script for downloading some podcasts and tagging the files so I can import them to iTunes.
"""
import pycurl
import os.path
import sys
from BeautifulSoup import BeautifulStoneSoup
import eyed3
@nishad
nishad / s2t.py
Created November 8, 2016 05:42
Python script that converts x100s RAF into x100t RAF, thus enabling the classic chrome profile option.
import os
import glob
dirpath = os.path.dirname(__file__)
filecount = 0
for filename in glob.glob(os.path.join(dirpath, '*.RAF')):
print("processing: {}".format(filename))
fh = open(filename, "r+b")
fh.seek(368)