- 2 tbsp olive oil
- 1 onion, chopped
- 1 green bell pepper, chopped
- 1 garlic clove, minced
- 2 cups of medium or long-grain white rice
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
filename = "test.jpg" | |
size = File.size(filename) | |
count = %x{wc -l #{filename}}.split.first.to_i | |
factor = count/300 | |
factor = 1 if factor < 1 | |
File.open(filename, "rb+") do |file| | |
# skip some | |
file.seek(size/(rand(10..20)), IO::SEEK_CUR) |
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
-- Ada Lovelace is credited with writing the first program (one which calculated Bernoulli numbers) | |
-- Many years later the Ada programming language was created | |
-- | |
-- This Ada uses the following algorithm for computing Bernoulli numbers | |
-- (http://en.wikipedia.org/wiki/Bernoulli_number#Algorithmic_description) | |
with Ada.Text_IO; | |
use Ada.Text_IO; | |
with Ada.Float_Text_IO; -- in Ada Float IO is treated differently from text IO, same goes for integers | |
use Ada.Float_Text_IO; |
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
# The following is a quick and dirty example of uploading to vimeo using ruby | |
# It assumes that you already have an access token for a user | |
require 'net/http' | |
require 'httparty' | |
ACCESS_TOKEN = "your access token here" | |
auth = "Bearer #{ACCESS_TOKEN}" | |
# get ticket |
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
// rainbow the main LED on twitter mention (just setup an IFTTT to trigger the publish of an even with "bloop") | |
void setup() { | |
Particle.subscribe("bloop", myHandler); | |
RGB.control(true); | |
} | |
void loop() { | |
//nothing to see here! | |
} |
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
// checks for collisions using the separating axis theorem | |
bool VWCar::isColliding(VWCollisionObject* colObj){ | |
int i; | |
// define the axes: 2 from collision object 2 from car | |
vector<ofxVec2f*> axes; | |
axes.reserve(4); | |
vector<ofxVec2f*>* objCorners = colObj->getCorners(); | |
if(objCorners->empty()){ |
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
ofxVec2f vecE, vecF; | |
double s,t; | |
float Ax, Ay, Bx, By, Cx, Cy, Dx, Dy; | |
bool found = false; | |
for (int i=0; i<4; i++) { | |
Ax = objCorners->at(i)->x; | |
Ay = objCorners->at(i)->y; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
char* toBase26(int num){ | |
char* str; | |
str = malloc(sizeof(char)*10); | |
char* temp = str; | |
while(num > 0){ |
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
- "Hardcore tea action!" | |
- "Physics!" | |
- "Explosion sound!" | |
- "Over 15 achievements!" | |
- "Coming soon!" | |
- "Danger!" | |
- "M-M-M-Monster kill!" | |
- "Single player experience!" | |
- "The 2015's best tea simulation game!" | |
- "Probably at least an entire hour of gameplay!" |
OlderNewer