Skip to content

Instantly share code, notes, and snippets.

View Hugoberry's full-sized avatar

Igor Cotruta Hugoberry

View GitHub Profile
@sgmurphy
sgmurphy / podcast-ratings.php
Created February 21, 2012 19:31
Scrape ratings from iTunes store
<?php
/**
* Scrape the number of podcast reviews from iTunes for all country specific storefronts.
*
* @author Sean Murphy <sean@iamseanmurphy.com>
*/
$podcast_id = '366931951'; // Startups For the Rest of Us
//$podcast_id = '318567721'; // techzing
@RickKimball
RickKimball / SPI.h
Created April 17, 2012 16:35
msp430 mono audio from sdcard using Petit Fat FileSystem
//-----------------------------------------------------------------------------
// SPI.h - common function declarations for different SPI implementations
//-----------------------------------------------------------------------------
#ifndef SPI_H_
#define SPI_H_
/**
* SMCLK divider arguments for spi_set_divisor
* assumes 16MHz SMCLK. You need to change if you
* use a different frequency
@harlantwood
harlantwood / push_to_github.rb
Created June 15, 2012 07:27
Commit and push via Github REST API, from ruby RestClient
# Committing changes to a repo via the Github API is not entirely trivial.
# The five-step process is outlined here:
# http://developer.github.com/v3/git/
#
# Matt Swanson wrote a blog post translating the above steps into actual API calls:
# http://swanson.github.com/blog/2011/07/23/digging-around-the-github-api-take-2.html
#
# I was not able to find sample code for actually doing this in Ruby,
# either via the HTTP API or any of the gems that wrap the API.
# So in the hopes it will help others, here is a simple function to
@trdarr
trdarr / cps.js
Created October 11, 2012 06:26
"Thunks, Trampolines, and Continuation Passing" in JavaScript
/* "Thunks, Trampolines, and Continuation Passing"
* Python implementation from http://jtauber.com/blog/2008/03/30/
* JavaScript implementation by Thomas Darr <me@trdarr.com>.
*/
// thunk = lambda name: lambda *args: lambda: name(*args)
var thunk = function thunk(fn) {
return function _thunk() {
var splat = Array.prototype.slice.apply(arguments);
return function __thunk() { return fn.apply(this, splat); };
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@simcop2387
simcop2387 / gist:5493206
Last active May 4, 2022 10:57
List of all named curves on wolfram alpha!
{"Archimedean spiral",
"Archimedes’ spiral",
"astroid",
"astroid pedal curve",
"bifoliate",
"bifolium",
"butterfly catastrophe curve",
"second butterfly curve",
"cardioid",
"cardioid pedal curve",
@ptman
ptman / watchdog.ps1
Created September 19, 2013 12:59
SuperMicro IPMI Watchdog for Windows
# coding: utf-8
# vim: set ts=4 sw=4 sts=4 si ai et ft=powershell:
# Copyright (c) 2013, ZenRobotics Ltd.
# author: Paul Tötterman <paul.totterman@zenrobotics.com>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
@davidjgraph
davidjgraph / customEdge.html
Created December 2, 2013 13:43
Custom edge example for mxGraph
<!--
$Id: markers.html,v 1.4 2013/10/28 08:44:55 gaudenz Exp $
Copyright (c) 2006-2014, JGraph Ltd
Demonstrates creating a custom edge in mxGraph
-->
<html>
<head>
<title>Custom edge example for mxGraph</title>
@mziwisky
mziwisky / Oauth2.md
Last active February 15, 2024 23:31
Oauth2 Explanation

OAUTH2

The Problem

I’m a web app that wants to allow other web apps access to my users’ information, but I want to ensure that the user says it’s ok.

The Solution

I can’t trust the other web apps, so I must interact with my users directly. I’ll let them know that the other app is trying to get their info, and ask whether they want to grant that permission. Oauth defines a way to initiate that permission verification from the other app’s site so that the user experience is smooth. If the user grants permission, I issue an AuthToken to the other app which it can use to make requests for that user's info.

Note on encryption

Oauth2 has nothing to do with encryption -- it relies upon SSL to keep things (like the client app’s shared_secret) secure.

@riccardoscalco
riccardoscalco / README.md
Last active January 11, 2022 16:20
Twitter Influencers

Twitter users visibility by means of regular Markov chains.

This is an attempt to define user visibility on a specific topic. Briefly, tweets are collected via the Twitter streaming API, stored in sqlite databases and then processed in order to create a regular Markov chain. The steady state distribution of the chain defines a metric on the set of Twitter users, which can be used to retrieve an ordered list of users.

Have a look at this paper and this other paper for further details about the mathematical methods.

Be careful, the procedure described here is experimental and it is not meant to be used in production environments.

Fetching and storing from the Twitter streaming