Skip to content

Instantly share code, notes, and snippets.

View pale2hall's full-sized avatar
💻
Doing @tboltusa stuff!

Vince Pale pale2hall

💻
Doing @tboltusa stuff!
View GitHub Profile
@hangxingliu
hangxingliu / github-markdown-print.js
Created May 23, 2018 19:26
GitHub Markdown Print Script
// Refrence from: https://gist.github.com/beevelop/a0f2c76e79610dca01550c9a93f83876
// Copy following scripts in the developer console of page included markdown content you want to print:
(function () {
var $ = document.querySelector.bind(document);
$('#readme').setAttribute('style', 'position:absolute;top:0;left:0;right:0;bottom:0;z-index:100;background-color:white');
$('#readme>article').setAttribute('style', 'border: none');
$('body').innerHTML = $('#readme').outerHTML;
window.print();
})();
@ahallora
ahallora / getSpotifyAccessToken
Last active March 17, 2023 09:44
Get Spotify Access Token (client credentials) with PHP and cURL
<?php
$client_id = '<insert your spotify app client id>';
$client_secret = '<insert your spotify app client secret>';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://accounts.spotify.com/api/token' );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, 'grant_type=client_credentials' );
@poezn
poezn / gist:4278379
Created December 13, 2012 18:07
Bookmarklet that converts the contents of a <table> to CSV and appends it to a textarea after the table
javascript:javascript:%20(function()%20{if%20(%27undefined%27==typeof%20jQuery)%20{script%20=%20document.createElement(%20%27script%27%20);script.src%20=%20%27http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js%27;script.onload=tables2CSV;document.body.appendChild(script);}else%20{tables2CSV();}function%20tables2CSV()%20{$(%27table%27).each(function()%20{var%20$table%20=%20$(this);$(%27<textarea/>%27).css(%27border%27,%20$table.css(%27border%27)).css(%27width%27,%20$table.width()).html($.map($table.find(%27tr%27),%20function(tr)%20{return%20$.map($(tr).find(%27th,%20td%27),%20function(e)%20{return%20%27%22%27%20+%20$(e).text().trim().replace(%27%22%27,%20%27%22%22%27)%20+%20%27%22%27}).join(%27,%27)}).join(%27\n%27)).insertAfter($table);});}})();