Skip to content

Instantly share code, notes, and snippets.

var background = (function () {
var tmp = {};
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
for (var id in tmp) {
if (tmp[id] && (typeof tmp[id] === "function")) {
if (request.path === "background-to-page") {
if (request.method === id) tmp[id](request.data);
}
}
}
var background = (function () {
var tmp = {};
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
for (var id in tmp) {
if (tmp[id] && (typeof tmp[id] === "function")) {
if (request.path === "background-to-page") {
if (request.method === id) tmp[id](request.data);
}
}
}
var background = (function () {
var tmp = {};
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
for (var id in tmp) {
if (tmp[id] && (typeof tmp[id] === "function")) {
if (request.path === "background-to-page") {
if (request.method === id) tmp[id](request.data);
}
}
}
var background = (function () {
var tmp = {};
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
for (var id in tmp) {
if (tmp[id] && (typeof tmp[id] === "function")) {
if (request.path === "background-to-page") {
if (request.method === id) tmp[id](request.data);
}
}
}
var background = (function () {
var tmp = {};
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
for (var id in tmp) {
if (tmp[id] && (typeof tmp[id] === "function")) {
if (request.path === "background-to-page") {
if (request.method === id) tmp[id](request.data);
}
}
}
var background = (function () {
var tmp = {};
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
for (var id in tmp) {
if (tmp[id] && (typeof tmp[id] === "function")) {
if (request.path === "background-to-page") {
if (request.method === id) tmp[id](request.data);
}
}
}
/*
*
* 2016-01-08: Added support for 5GHz networks. Specifying network
* type is optional. As a bonus you get less candidates. :-)
*
* 2021-05-20: All generated passwords are stored in a text file.
*
* P.S. Reversing eCos and broadcom CFE sux
*
* $ gcc -O2 -o upc_keys upc_keys.c -lcrypto
@step135
step135 / font-stacks.css
Created March 30, 2021 14:02 — forked from 001101/font-stacks.css
Similar looking fonts for Windows, Linux, Mac
.mono-font-stack {
font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;
}
.times-font-stack {
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
}
.modern-font-stack {
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
@step135
step135 / submit.md
Created March 28, 2021 11:00 — forked from tanaikech/submit.md
Upload Files to Google Drive using Javascript

Upload Files to Google Drive using Javascript

News

At October 11, 2019, I published a Javascript library to to run the resumable upload for Google Drive. When this is used, the large file can be uploaded. You can also use this js library.

Description

This is a sample script for uploading files to Google Drive using Javascript. The files are uploaded by Drive API v3. gapi.client.drive.files.create() can create an empty file on Google Drive. But it cannot directly upload files including contents. I think that this might not be able to upload files and metadata with the multipart/related, although this might be resolved by the future update. So now, as one of workarounds, I use using XMLHttpRequest.

  • This sample uses gapi.
  • Before you use this, please enable Drive API at API console and carr
const username = ""
const password = ""
const fs = require('fs');
const libpath = require('path');
const { GPhotos } = require('upload-gphotos');
const gphotos = new GPhotos();