Skip to content

Instantly share code, notes, and snippets.

View Olliepop's full-sized avatar
💁‍♂️

Oliver Shaw Olliepop

💁‍♂️
View GitHub Profile
@jbuchbinder
jbuchbinder / string_to_ascii.go
Created May 3, 2013 20:39
Convert UTF-8 Go strings to ASCII bytes.
package main
import (
"unicode/utf8"
)
// Fake converting UTF-8 internal string representation to standard
// ASCII bytes for serial connections.
func StringToAsciiBytes(s string) []byte {
t := make([]byte, utf8.RuneCountInString(s))
@cosmocatalano
cosmocatalano / instagram_scrape.php
Last active August 6, 2023 07:32
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;
}
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@evo42
evo42 / aloha-config.js
Created December 8, 2011 19:52
Aloha Editor -- send content via ajax to a backend php script to save the data edited with Aloha Editor
( function ( window, undefined ) {
var Aloha = window.Aloha || ( window.Aloha = {} );
Aloha.settings = {
logLevels: { 'error': true, 'warn': true, 'info': true, 'debug': false, 'deprecated': true },
errorhandling: false,
ribbon: false,
locale: 'en',
floatingmenu: {
width: 630,