Skip to content

Instantly share code, notes, and snippets.

@vijo
vijo / titleUrlMarkdownClip.js
Created September 22, 2021 17:16 — forked from idelem/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
@vijo
vijo / yt-embed.js
Created January 20, 2016 10:06 — forked from do18/yt-embed.js
If you are concerned about web site performance, you probably noticed that embedded YouTube iframes are costly. Instead of iframes, you may embed images that link to the respective videos, and make these links replace themselves with iframes when clicked. (IE 9+ because of getElementsByClassName.)
/*jshint maxlen: 79 */
var MYSITE = {};
/**
* Make YouTube links with .yt-embed replace themselves with YouTube
* iframes when clicked; firstElementChild is assumed to be the
* img element holding the poster frame; the YouTube URL must contain
* the "v" parameter and no further parameters.
*
# coding=UTF-8
from __future__ import division
import re
# This is a naive text summarization algorithm
# Created by Shlomi Babluki
# April, 2013
class SummaryTool(object):
import csv
import json
some_dict = {}
filename = "periodictabledump2.csv"
with open(filename, 'r', newline='') as csvfile:
ofile = csv.reader(csvfile, delimiter=',')
ofile.__next__()
@vijo
vijo / GmailHelper.java
Last active December 28, 2015 05:22 — forked from nutanc/GmailHelper.java
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.auth.oauth2.TokenResponse;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeRequestUrl;
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.api.client.googleapis.auth.oauth2.GoogleTokenResponse;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpTransport;