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 / simple_google_analytics.rb
Created March 22, 2016 08:57 — forked from chrisle/simple_google_analytics.rb
My simple Google Analytics API export API. Exports GA data as an array of flattened hashes with a SHA1 signature. No DSL, no sugar.
require 'digest'
# = simple_google_analytics.rb
#
# Chris Le <chris at iamchrisle dot com>
#
# This module is an wrapper to export data from Google Analytics as a flattened
# hash suitable for database storage. It does not require any other gems other
# than 'oauth'. I used this simply to get metrics and directly store them in
# a database.
@nishad
nishad / mobtable.html
Created March 31, 2016 07:25 — forked from hkirsman/mobtable.html
turn tables into mobile friendly
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="et">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>table</title>
<style type="text/css">
.odd { background-color: #808080; }
.generated_for_mobile { margin-bottom: 30px }
@nishad
nishad / test-curl.php
Created July 13, 2016 23:22
Simple Curl PHP Example
function curl_download($Url){
// is cURL installed yet?
if (!function_exists('curl_init')){
die('Sorry cURL is not installed!');
}
// OK cool - then let's create a new cURL resource handle
$ch = curl_init();
@nishad
nishad / keybase.md
Created August 12, 2016 18:56
Keybase proof

Keybase proof

I hereby claim:

  • I am nishad on github.
  • I am rimpo (https://keybase.io/rimpo) on keybase.
  • I have a public key whose fingerprint is CD72 736D C01E A219 130C 3AB4 1E06 BB9E B6F5 1A54

To claim this, I am signing this object:

<?php
/**
* cURL
*
* @author CertaiN
* @github https://github.com/Certainist/cURL
* @license BSD 2-Clause
*/
class cURL implements Serializable {
@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)
@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 / 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 / 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 / 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