Skip to content

Instantly share code, notes, and snippets.

View shijithpk's full-sized avatar
📖
Giving myself the tools to become a better journalist

Shijith Kunhitty shijithpk

📖
Giving myself the tools to become a better journalist
View GitHub Profile
@planemad
planemad / india_pc_2024_simplified.geojson
Last active June 5, 2024 05:38
India Parliamentary Constituencies Shape 2024
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@robbibt
robbibt / array_to_xarray.py
Created November 18, 2020 05:46
Convert numpy array back to xarray
xr.DataArray(array, coords=da.coords, dims=da.dims, attrs=da.attrs)
@lightonphiri
lightonphiri / bash-install_google_fonts_on_ubuntu.md
Last active November 13, 2024 06:58
Install Google Fonts on Ubuntu

Install Google Fonts

Download desired fonts

https://fonts.google.com/?selection.family=Open+Sans

Install Google Fonts on Ubuntu

cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip

import urllib2
import json
import csv
def write_to_csv(url):
response = urllib2.urlopen(url)
track_list = json.load(response)
for song in track_list:
#!/usr/bin/env python
# Author: David Huss
# Website: http://blog.atoaudiovisual.com
# Usage instructions http://blog.atoav.com/2013/09/restore-broken-deja-dup-backup-hand/
# Modified by Antonio Roberts to preserve folder structure
import Tkinter as tk
from tkFileDialog import *
import sys, os
@frankkienl
frankkienl / Countries.java
Last active November 1, 2024 14:01
List of countries
/*
The Spotify API call, 'top-tracks' requires a ISO 3166-1 alpha-2 country code
//https://developer.spotify.com/web-api/get-artists-top-tracks/
//https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
//https://www.spotify.com/nl/legal/end-user-agreement/plain/#s19
//EU is not included in this list, as it generates this error:
{
"error": {
"status": 400,
"message": "Invalid country code"
@zhenyi2697
zhenyi2697 / findLastFriday.py
Created March 9, 2013 07:41
Python: datetime: find last friday
#/usr/bin/python
import datetime, calendar
lastFriday = datetime.date.today()
oneday = datetime.timedelta(days=1)
while lastFriday.weekday() != calendar.FRIDAY:
lastFriday -= oneday
print lastFriday.strftime("%D")