This file contains hidden or 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
import os | |
import datetime | |
import libhoney | |
from github import Github | |
g = Github(os.getenv('GH_ACCESS_TOKEN')) | |
libhoney.init( | |
writekey=os.getenv('HONEYCOMB_WRITE_KEY'), | |
dataset=os.getenv('HONEYCOMB_DATASET'), |
This file contains hidden or 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
import pybreaker | |
import soundcloud | |
import requests | |
sc_breaker = pybreaker.CircuitBreaker(fail_max=3, reset_timeout=30) | |
class LogListener(pybreaker.CircuitBreakerListener): | |
def before_call(self, cb, func, *args, **kwargs): | |
print "Before calling %s" % func |
This file contains hidden or 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
<?php | |
require_once 'Services/Soundcloud.php'; | |
$client = new Services_Soundcloud('A_VALID_CLIENT_ID', 'A_VALID_CLIENT_SECRET', 'REDIRECT_URI'); | |
// manually construct URL-encoded request body. Note that if you use an email address | |
// as the username, you'll need to pass it through urlencode(). | |
$options = "grant_type=password&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&username=<username>&password=<password>"; |
This file contains hidden or 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
from django.db import models | |
class Author(models.Model): | |
name = models.CharField(max_length=255) | |
class Book(models.Model): | |
title = models.CharField(max_length=255) | |
author = models.ForeignKey(Author) |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<script src="http://connect.soundcloud.com/sdk.js"></script> | |
<script> | |
window.onload = function() { | |
SC.initialize({ | |
client_id: 'YOUR_CLIENT_ID' | |
}); | |
This file contains hidden or 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
Hi [Name], | |
Thanks for reaching out. It sounds like it could be an interesting position, but I'm very happy with my current position at SoundCloud. | |
Best of luck finding the right candidate! | |
Cheers, | |
Paul |
This file contains hidden or 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
<?php | |
require_once 'Services/Soundcloud.php'; | |
$client = new Services_Soundcloud('client_id', 'client_secret'); | |
$client->setAccessToken('access_token'); | |
$playlist = array( | |
'playlist[title]' => 'My Playlist', | |
'playlist[artwork_data]' => '@/path/to/file.jpg' |
This file contains hidden or 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
import soundcloud | |
from bottle import get, post, redirect, request | |
def soundcloud_client(): | |
return soundcloud.Client( | |
client_id='YOUR_CLIENT_ID', | |
client_secret='YOUR_CLIENT_SECRET', | |
redirect_uri='http://localhost:3000/soundcloud/connected' | |
) |
This file contains hidden or 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
import soundcloud | |
# Create a new client that uses the user credentials oauth flow | |
client = soundcloud.Client(client_id='YOUR_CLIENT_ID', | |
client_secret='YOUR_CLIENT_SECRET', | |
username='YOUR_USERNAME', | |
password='YOUR_PASSWORD') | |
# print the username of the authorized user | |
print client.get('/me').username |
This file contains hidden or 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
# Rails 3.0.3 Controller. Just return the parameters as a string. | |
class HomeController < ApplicationController | |
protect_from_forgery :except => :upload | |
def upload | |
render :text => params.to_s | |
end | |
end |
NewerOlder