This file contains 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 pygame | |
# Initialize Pygame | |
pygame.init() | |
# Set the window size and title | |
screen_size = (600, 400) | |
screen = pygame.display.set_mode(screen_size) | |
pygame.display.set_caption("Bouncing Ball") |
This file contains 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
Most analytics tools are made to help app makers study what users are doing in some specific type of app. This kind of tool works okay, provided your app looks enough like the others apps the tool was built for, and your users’ behaviors are enough like the behaviors in those other apps. What if your app is unique, and the questions you have are unique? (Before Keen, the state of the art was to build your own Observatory from scratch.) | |
The data model breadth of those tools may not be enough for you. What if user behavior in the app layer is only a part of your business? What if you want to study your marketing website copy, your paid acquisition funnel, the response time performance of your your webservices layer, all in the same system? (Before Keen, the state of the art was to build your own Observatory from scratch.) | |
What if you want other humans — your customers, your partners, your merchants, or just other departments in your company — to get value from the same data? What if you wanted applications to |
This file contains 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
// Determine if an element is in the visible viewport | |
// The function could be used by adding a “scroll” event listener to the window and then calling isInViewport(). | |
function isInViewport(element) { | |
let rect = element.getBoundingClientRect(); | |
let html = document.documentElement; | |
return ( | |
rect.top >= 0 && | |
rect.left >= 0 && | |
rect.bottom <= (window.innerHeight || html.clientHeight) && | |
rect.right <= (window.innerWidth || html.clientWidth) |
This file contains 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
// Determine if an element is in the visible viewport | |
function isInViewport(element) { | |
var rect = element.getBoundingClientRect(); | |
var html = document.documentElement; | |
return ( | |
rect.top >= 0 && | |
rect.left >= 0 && | |
rect.bottom <= (window.innerHeight || html.clientHeight) && | |
rect.right <= (window.innerWidth || html.clientWidth) | |
); |
This file contains 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
This is just one small piece of this mostrosity. | |
read on. | |
MEDICARE AT AGE 76, IMPORTANT PLEASE READ - ANYONE WHO DOUBTS THIS IS | |
TRUE CAN DOWNLOAD THE NEW OBAMA CARE AND LOOK UP THE PAGES MENTIONED. | |
THIS IS JUST THE BEGINNING......................PLEASE PASS THIS | |
OUTRAGE TO EVERYONE ON YOUR LIST!!! THIS should be read by everyone, | |
especially important to those over 75....... If you are younger, then | |
it may apply to your parents.... |
This file contains 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
Keen.configure(window.ENV.keenProjectId,window.ENV.keenApiKey), | |
Keen.onChartsReady(function(){ | |
var e=new Keen.Series("connect",{ | |
analysisType:"count", | |
timeframe:"last_7_days", | |
interval:"daily" | |
}), | |
t=new Keen.Series("connect",{ |
This file contains 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
adroit@Kyles-MacBook-Air:~/Dropbox/dev/Keen-Clients/ $ gem install keen | |
Building native extensions. This could take a while... | |
ERROR: Error installing keen: | |
ERROR: Failed to build gem native extension. | |
/Users/adroit/.rvm/rubies/ruby-1.9.2-p136/bin/ruby mkrf_conf.rb | |
"/Users/adroit/.rvm/rubies/ruby-1.9.2-p136/bin/ruby" -rubygems /Users/adroit/.rvm/gems/ruby-1.9.2-p136@global/gems/rake-0.8.7/bin/rake RUBYARCHDIR=/Users/adroit/.rvm/gems/ruby-1.9.2-p136/gems/keen-0.1.6/lib RUBYLIBDIR=/Users/adroit/.rvm/gems/ruby-1.9.2-p136/gems/keen-0.1.6/lib | |
rake aborted! | |
no such file to load -- bundler |
This file contains 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
# git convenience functions | |
function grso() { | |
git remote show origin ; | |
} | |
function mkremotebranch() { | |
git branch "$@" ; | |
git checkout "$@" ; | |
git push -u origin "$@" ; | |
} |
This file contains 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
""" | |
A sample use case for DSTruct ( https://github.com/dorkitude/dstruct ) | |
Let's pretend we're implementing the in-app purchase feature of a mobile game, | |
and there's a remote payments API over which we have no control. To make | |
matters worse, their API doesn't support versioning and their client library | |
isn't properly encapsulated, so when they make an update to the API spec, we | |
have to handle it in our code. As a result, our spec demands type checking not | |
only to preempty failures when we post resources, but to vet the response. |
This file contains 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
class BaseTestCase(unittest.TestCase): | |
""" | |
Extend this with your test cases to get some sweet shit! | |
- Provides: | |
- Instance methods: | |
- self.persist_item(item) # Use instead of item.save() | |
- self.set_up() | |
- a subclass's method *must* call super |
NewerOlder