Skip to content

Instantly share code, notes, and snippets.

View linglung's full-sized avatar

linglung

  • C+ Java
View GitHub Profile
@sheharyarn
sheharyarn / YoutubeDownloader.md
Last active October 15, 2022 06:26
Download Videos from Youtube in (Ruby || PHP)

Youtube Downloaders

Download Youtube Videos using Ruby or PHP

Just copy the appropriate script, provide the video_id and run. It will list download links for different qualities and streams.

:P

@kurokikaze
kurokikaze / gist:350fe1713591641b3b42
Created October 3, 2014 11:40
install chrome from powershell
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec
@mhawksey
mhawksey / main.js
Last active March 9, 2020 02:09
Using Google Apps Script to proxy YouTube Analytics Channel report data http://mashe.hawksey.info/?p=16234
// instead of var results = YouTubeAnalytics.Reports.query(ids, start-date, end-date, metrics, optionalArgs);
var params = {"method" : "post",
"payload" : {'ids' : query.ids,
"startDate" : startDate,
"endDate": endDate,
"metrics": query.metrics,
"options": JSON.stringify(options)
}
};
var yt_data = UrlFetchApp.fetch("https://script.google.com/macros/s/YOUR_APP_ID/exec", params);
@auycro
auycro / getDesktopPath.pas
Created June 13, 2014 03:26
Get Desktop Path #Delphi
uses ShlObj, ComObj, ActiveX;
//GET DESKTOP FOLDERS
function GetSystemPath(Folder: Integer): string;
var
PIDL: PItemIDList;
Path: LPSTR;
AMalloc: IMalloc;
begin
Path := StrAlloc(MAX_PATH);
@varun-raj
varun-raj / pullJSON.js
Last active March 15, 2025 17:32
Google App Script To Fetch Data From JSON Webservice and Write them to google spreadsheet.
function pullJSON() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
var sheet = ss.getActiveSheet();
var url="http://example.com/feeds?type=json"; // Paste your JSON URL here
var response = UrlFetchApp.fetch(url); // get feed
var dataAll = JSON.parse(response.getContentText()); //
// ==UserScript==
// @name Youtube Download Video
// @namespace http://www.strikeskids.com
// @version 0.05
// @description Creates a download button on youtube videos to enable them to be downloaded
// @match http*://*.youtube.com/watch*v=*
// @copyright 2014+, Strikeskids
// @require http://code.jquery.com/jquery-latest.js
// @run-at document-end
// @author Strikeskids
@vs4vijay
vs4vijay / GetDataFromXPath
Created September 27, 2013 06:35
Extract Data from XPath via Google Apps Script
function getDataFromXpath(path, url) {
var data = UrlFetchApp.fetch(url);
var text = data.getContentText();
var xmlDoc = Xml.parse(text, true);
// Replacing tbody tag because app script doesnt understand.
path = path.replace("/html/","").replace("/tbody","","g");
var tags = path.split("/");
Logger.log("tags : " + tags);
// getting the DOM of HTML

SheetConverter library (formerly "Spreadsheet to HTML")

This is the source repository for the SheetConverter Google Apps Script library.

Libary documentation is available here.

Caveats

This script is incomplete, ignoring some types of formatting. (Feel free to fork and enhance it, if you wish! Broadly applicable enhancements can be merged and the library updated) There are also some known issues:

@nylen
nylen / inject.js
Last active December 13, 2021 16:53
JavaScript file to allow injecting scripts into a page using GreaseMonkey/TamperMonkey and running a callback when loading is complete. Based on http://stackoverflow.com/questions/6725272/dynamic-cross-browser-script-loading .
function inject(src, callback) {
if (typeof callback != 'function') callback = function() { };
var el;
if (typeof src != 'function' && /\.css[^\.]*$/.test(src)) {
el = document.createElement('link');
el.type = 'text/css';
el.rel = 'stylesheet';
el.href = src;
@Integralist
Integralist / regex.js
Created March 11, 2013 15:15
The difference between JavaScript's `exec` and `match` methods is subtle but important, and I always forget...
var str = "The quick brown fox jumped over the box like an ox with a sox in its mouth";
str.match(/\w(ox)/g); // ["fox", "box", "sox"]
// match (when used with a 'g' flag) returns an Array with all matches found
// if you don't use the 'g' flag then it acts the same as the 'exec' method.
str.match(/\w(ox)/); // ["fox", "ox"]
/\w(ox)/.exec(str); // ["fox", "ox"]