This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//URL: https://api.linkedin.com/v1/people/~/shares | |
//Request params: | |
Array | |
( | |
[content] => Array | |
( | |
[submitted-url] => http://forestnation.com/ | |
[title] => Imagine ForestNation | |
[submitted-image-url] => http://forestnationcdn.forestnation.netdna-cdn.com/wp-content/uploads/2013/05/FN-World-150.png | |
[description] => Imagine a world where everyone grows their own tree. You plant one We plant one - Imagine ForestNation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This function handles a Slack slash command and echoes the details back to the user. | |
Follow these steps to configure the slash command in Slack: | |
1. Navigate to https://<your-team-domain>.slack.com/services/new | |
2. Search for and select "Slash Commands". | |
3. Enter a name for your command and click "Add Slash Command Integration". | |
4. Copy the token string from the integration settings and use it in the next section. | |
5. After you complete this blueprint, enter the provided API endpoint URL in the URL field. | |
Follow these steps to encrypt your Slack token for use in this function: | |
1. Create a KMS key - http://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ContentValues values = new ContentValues(); | |
values.put(MediaStore.Images.Media.TITLE, BufferUtils.getOutputImageFilename()); | |
sFileUri = getActivity().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); | |
//sFileUri = BufferUtils.getOutputMediaFileUri(BufferUtils.MEDIA_TYPE_IMAGE); | |
intent.putExtra(MediaStore.EXTRA_OUTPUT, sFileUri); // set the image file name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
commit=`git log | grep commit | head -1 | cut -d ' ' -f2` | |
echo $commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global user.name 'Sunil Sadasivan' | |
git config --global user.email email@email.com | |
git config --global core.editor vim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
section: screens | |
laptop: | |
desktop: | |
netbook: | |
end | |
section: aliases | |
laptop: | |
192.168.1.134 | |
sunil-laptop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Given a youtube url, return the youtube id. | |
//There are several versions of youtube urls that work. | |
//http://www.youtube.com/v/0zM3nApSvMg?fs=1&hl=en_US&rel=0 | |
//http://www.youtube.com/embed/0zM3nApSvMg?rel=0 | |
//http://www.youtube.com/watch?v=0zM3nApSvMg&feature=feedrec_grec_index | |
//http://www.youtube.com/watch?v=0zM3nApSvMg | |
//http://youtu.be/0zM3nApSvMg | |
//http://www.youtube.com/watch?v=0zM3nApSvMg#t=0m10s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Given a base58 encoded string, obtain the base 10 number. | |
//This is useful for decoding shortened flickr urls. | |
function base58_decode( snipcode ) | |
{ | |
var alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ' ; | |
var num = snipcode.length ; | |
var decoded = 0 ; | |
var multi = 1 ; | |
for ( var i = (num-1) ; i >= 0 ; i-- ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @license The imageloader.js library is licensed under GNU Lesser General Public License v3 or later | |
*/ | |
(function(){ | |
/** | |
* TwitPic Image Loader | |
* Example: ldr = new TwitPicLoader("http://twitpic.com/asdf123"); | |
* @param {string} URL of the TwitPic page. Eg. http://twitpic.com/asdf123 | |
* @constructor | |
*/ |
NewerOlder