Skip to content

Instantly share code, notes, and snippets.

View answerquest's full-sized avatar

Nikhil VJ answerquest

View GitHub Profile
@ljmccarthy
ljmccarthy / youtube_screen_scrape.py
Last active March 24, 2021 01:11
An example of how to download metadata for all videos of a specified YouTube channel using simple BeautifulSoup screen scraping. The data will be much more up-to-date and reliable than the RSS feed or YouTube API results (which is a sad state of affairs really).
import urllib
import json
from bs4 import BeautifulSoup
from collections import namedtuple
Video = namedtuple("Video", "video_id title duration views thumbnail")
def parse_video_div(div):
video_id = div.get("data-context-item-id", "")
title = div.find("a", "yt-uix-tile-link").text
@larskotthoff
larskotthoff / flare.json
Last active March 14, 2017 19:55 — forked from mbostock/.block
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
@Shelob9
Shelob9 / 1-pods-loop-general-example.php
Last active April 9, 2025 15:01
Pods Looping Examples.
<?php
//set up pods::find parameters to limit to 5 items
$param = array(
'limit' => 5,
);
//create pods object
$pods = pods('pod_name', $params );
//check that total values (given limit) returned is greater than zero
if ( $pods->total() > 0 ) {
#!/bin/bash
# rename TMS tiles to the XYZ schema
# no quoting, since all files have simple numeric names
# do not run this anywhere else than INSIDE your tiles directory
# run it like this: find . -name "*.png" -exec ./tms2xyz.sh {} \;
filename=$1
tmp=${filename#*/} # remove to first /
@rdempsey
rdempsey / python_3_email_with_attachment.py
Created December 6, 2014 21:30
Use Python 3 to send an email with an attachment using Gmail
#!/usr/bin/env python
# encoding: utf-8
"""
python_3_email_with_attachment.py
Created by Robert Dempsey on 12/6/14.
Copyright (c) 2014 Robert Dempsey. Use at your own peril.
This script works with Python 3.x
NOTE: replace values in ALL CAPS with your own values
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {
@pratapvardhan
pratapvardhan / aam-aadmi-mohalla-clinics-in-delhi.csv
Created June 25, 2016 16:03
Aam Aadmi Mohalla Clinics in Delhi
District Sno Assembly Asno Address Status
North 1 NARELA 1 Sant Kirpal Singh Public Trust,811,GT Road Alipur,Delhi 36 Functioning
North 2 NARELA 1 Hno.246,Tyagi mohalla ,Narela,Delhi 36 Functioning
Central 3 Burari 2 PO Building ,Near Takia Chowk,Burari Functioning
Central 4 Burari 2 Mohalla Clinic Nathupura: - Budh Bazar Road,Nathupura,Burari,Delhi Functioning
Central 5 Timarpur 3 Khasara No -120,Gali No-17 ,Main Road,Wazirabad Functioning
North 6 Adarsh Nagar 4 H.No.467 D Near Budh Mandir,Village Azadpur Functioning
North 7 Badli 5 A-215,Bhalaswa Dairy Near Police Station Functioning
North West 8 Rithala 6 H.No. 231-32,Kh. No.28/ 19,Mange Ram Park,Budh,Vihar Phase-2,Deihi-86 Functioning
North West 9 Rithala 6 F4/6,Sector 16 Rohini,Delhi 85 Functioning
@gsomoza
gsomoza / s3-presign-url.py
Last active August 6, 2018 12:45
S3: Create Presigned Download URL
#!/usr/bin/env python
# Usage:
# s3-presign-url path/to/object
#
# 1) Install boto3:
# pip install boto3
# 2) Configure aws:
# aws configure
# 3) Change the bucket name in this script (below)
@danswick
danswick / README.md
Last active October 11, 2017 07:04
Get weather conditions along a route

Click to get a route and retrieve weather information at a given interval along the way. Currently displaying wind speed.

Includes superfluous data point extrusions.

@emoran
emoran / polygone_google_maps.html
Last active October 15, 2020 13:42
Adding polygone in google maps
<!DOCTYPE html>
<html>
<head>
<title>Drawing tools</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */