Skip to content

Instantly share code, notes, and snippets.

View labnol's full-sized avatar
🇮🇳
Building stuff for the Internet!

Amit Agarwal labnol

🇮🇳
Building stuff for the Internet!
View GitHub Profile
@labnol
labnol / obama.md
Last active August 29, 2015 14:00
Obama's entry from Wikipedia

Barack Obama

Barack Hussein Obama II (born August 4, 1961) is the 44th and current President of the United States, and the first African American to hold the office. Born in Honolulu, Hawaii, Obama is a graduate of Columbia University and Harvard Law School, where he served as president of the Harvard Law Review. He was a community organizer in Chicago before earning his law degree.

In 2004, Obama received national attention during his campaign to represent Illinois in the United States Senate with his victory in the March Democratic Party primary, his keynote address at the Democratic National Convention in July, and his election to the Senate in November. He began his presidential campaign in 2007 and, after a close primary campaign against Hillary Rodham Clinton in 2008, he won sufficient delegates in the Democratic Party primaries to receive the presidential nomination. He then defeated Republican nominee John McCain in the general election, and was inaugurated as president on January

Untitled Slide

Welcome to Glide.

Glide is the easiest way to create useful slide for all of your Gists.

  • input key <- to go backward.
  • input key -> to go forward.

Publishing

@labnol
labnol / gist:1907315
Created February 25, 2012 08:18 — forked from mhawksey/gist:1658408
Google Apps Script mashup to send free SMS notifications using Google Calendar guest invite feature
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@labnol
labnol / gist:1907325
Created February 25, 2012 08:20 — forked from mhawksey/gist:1106744
Google Apps Script - Social Bookmarking Counts
/*
All code apart from getPlusones()
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
/**
* POST data from a Google Spreadsheet to a remote URL, via menu option Add-ons > Post values
* See: http://www.google.com/google-d-s/scripts/guide.html for more info
*/
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var r = sheet.getRange("B5");
function onOpen() {
@labnol
labnol / gist:1907309
Created February 25, 2012 08:15 — forked from mhawksey/gist:1029258
Google Apps Script to display email notification
function doGet(e) {
try{
var app = UiApp.createApplication();
var mainPanel = app.createVerticalPanel();
var emailTable = app.createFlexTable().setId("emailTable");
app.add(mainPanel);
mainPanel.add(emailTable);
var mail = GmailApp.getInboxThreads(0, 10);
for (var i = mail.length; i > 0; i--) {
var msg = mail[i-1];
@labnol
labnol / youtubeOAuthGoogApps.js
Created February 25, 2012 08:16 — forked from psychemedia/youtubeOAuthGoogApps.js
Youtube OAuth in Google Apps Script
function youtube(){
// Setup OAuthServiceConfig
var oAuthConfig = UrlFetchApp.addOAuthService("youtube");
oAuthConfig.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken");
oAuthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope=http%3A%2F%2Fgdata.youtube.com%2F");
oAuthConfig.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken");
oAuthConfig.setConsumerKey("anonymous");
oAuthConfig.setConsumerSecret("anonymous");
// Setup optional parameters to point request at OAuthConfigService. The "twitter"
@labnol
labnol / twitterlinks.js
Created February 25, 2012 08:17 — forked from kurtraschke/twitterlinks.js
Google Apps Script to turn Twitter usernames into links
@labnol
labnol / updatetweets.js
Created February 25, 2012 08:17 — forked from kurtraschke/updatetweets.js
Google Apps Script to set cell comment to latest Tweet
function setComments() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var twitterDataRange = ss.getRangeByName("Twitter3");
vals = twitterDataRange.getValues();
for (i in vals) {
var row = vals[i];
for (j in row) {
var col = vals[i][j];
if (col.length > 0) {
@labnol
labnol / gist:1907314
Created February 25, 2012 08:18 — forked from mhawksey/gist:1442370
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = Utilities.jsonParse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}