Skip to content

Instantly share code, notes, and snippets.

/* WITH MODS TO ORIG -- iOS Browser Bookmarklets to launch other apps and stuff */
/* ver 2014-04-14a */
/* backing up my "Open In" bookmarks */
// note iOS6 requires some changes to these
// BEGIN TESTING STUFF -- IN PROFRESS LIKELY NOT WORKING
// SOME WORK, MOST tests are not WORK --
// PINNER APP TEST STUFF (as a private one)
// the page title as the title and your selected text as the description.
@spir1donov
spir1donov / instagram_scrape.php
Created January 24, 2016 08:32 — forked from cosmocatalano/instagram_scrape.php
Quick-and-dirty Instagram web scrape, just in case you don't think you should have to make your users log in to deliver them public photos.
<?php
//returns a big old hunk of JSON from a non-private IG account page.
function scrape_insta($username) {
$insta_source = file_get_contents('http://instagram.com/'.$username);
$shards = explode('window._sharedData = ', $insta_source);
$insta_json = explode(';</script>', $shards[1]);
$insta_array = json_decode($insta_json[0], TRUE);
return $insta_array;
}
@spir1donov
spir1donov / background.js
Created January 24, 2016 08:33 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@spir1donov
spir1donov / Install laravel
Created January 24, 2016 08:36
Install laravel
Install Composer: curl -sS https://getcomposer.org/installer | php
Move to global: sudo mv composer.phar /usr/local/bin/composer
Check Composer: php composer.phar
Install Laravel: composer create-project laravel/laravel (directory)
cd (directory)
run on port: php -S localhost:8000 -t public
@spir1donov
spir1donov / DI.m3u
Created January 24, 2016 08:38 — forked from sim642/DI.m3u
Digitally Imported premium streams
#EXTM3U
#EXTINF:-1,Digitally Imported - Ambient
http://pub1.diforfree.org:8000/di_ambient_hi
#EXTINF:-1,Digitally Imported - Big Room House
http://pub1.diforfree.org:8000/di_bigroomhouse_hi
#EXTINF:-1,Digitally Imported - Breaks
http://pub1.diforfree.org:8000/di_breaks_hi
@spir1donov
spir1donov / gist:728d79e029d555717d4d
Created January 24, 2016 08:43 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@spir1donov
spir1donov / tg-example-bot.pl
Created January 24, 2016 08:48 — forked from Robertof/tg-example-bot.pl
Basic Telegram bot implementation using WWW::Telegram::BotAPI
#!/usr/bin/env perl
# Basic Telegram Bot implementation using WWW::Telegram::BotAPI
use strict;
use warnings;
use WWW::Telegram::BotAPI;
my $api = WWW::Telegram::BotAPI->new (
token => (shift or die "ERROR: a token is required!\n")
);
@spir1donov
spir1donov / RightClick.applescript
Created April 30, 2016 16:12 — forked from vitorgalvao/Right Click.applescript
Make right-clicking on OSX accessible via a keyboard shortcut.
(*
Even though [a native solution](http://stackoverflow.com/questions/9171613/right-click-shortcut-for-mac-lion-os) exists, it still suffers from a big flaw (it right-clicks the place you cursour is, not what you’re selecting). This addresses that limitation.
You can install this as a [Finder Service, , and later asign it a keyboard shortcut](http://www.macosxautomation.com/services/learn/tut01/index.html).
*)
tell application "System Events" to set frontApp to name of first process whose frontmost is true
@spir1donov
spir1donov / GIF-Screencast-OSX.md
Created December 26, 2016 11:11 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@spir1donov
spir1donov / ajax-file-upload.js
Created June 29, 2017 07:14 — forked from nilcolor/ajax-file-upload.js
Upload file using FormData (a-la AJAX file upload using XMLHTTPRequest2)
function sendForm() {
var fileData = new FormData(document.getElementById("cpd-file"));
var xhr = new XMLHttpRequest();
xhr.open("POST", "/upload_file", true);
xhr.setRequestHeader('Accept', 'application/json');
xhr.onload = function(progressEvent) {
if (xhr.status == 200) {
console.log('Uploaded', xhr);
} else {