Skip to content

Instantly share code, notes, and snippets.

@brunokruse
brunokruse / return paragraphs list for image
Created January 27, 2014 16:18
get_paragraphs_for_image_id()
// calls for getting a list of paragraphs for an image id from url
// api/images/get_paragraphs_for_image_id/?id=374
public function get_paragraphs_for_image_id() {
global $json_api;
$id = $json_api->query->id;
$paragraphs_list = $this->find_matching_paragraphs($id);
return $paragraphs_list;
}
@brunokruse
brunokruse / gist:7951153
Created December 13, 2013 20:53
get_all_chapters
{
"Chapters": {
"Fashion": {
"Paragraphs": [
{
"description": "string",
"id": 426,
"images": [],
"title": "Twiggy"
}
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title></title>
<link rel="stylesheet" type="text/css" media="screen" href="css/master.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="processing-1.4.1.min.js"></script>
<!--[if IE]>
@brunokruse
brunokruse / flask
Created April 25, 2013 22:24
flask structure
.
.
├── app
│ ├── static
│ │ ├── css
│ │ ├── img
│ │ └── js
│ ├── templates
│ ├── routes.py
│ └── README.md
@brunokruse
brunokruse / gist:4675129
Created January 30, 2013 17:51
f5buffer link
java.lang.UnsatisfiedLinkError: Couldn't load F5Buffers from loader dalvik.system.PathClassLoader[dexPath=/data/app/info.guardianproject.pixelknot-1.apk,libraryPath=/data/app-lib/info.guardianproject.pixelknot-1]: findLibrary returned null
@brunokruse
brunokruse / PixelKnot Log
Created January 30, 2013 16:25
Android Memory
I/PanoMetadata( 1969): Image has no metadata and no 2:1 aspect ratio. Not a pano!
D/dalvikvm( 564): GC_FOR_ALLOC freed 779K, 28% free 14955K/20660K, paused 75ms, total 75ms
D/dalvikvm( 2957): GC_FOR_ALLOC freed 55K, 4% free 6654K/6896K, paused 19ms, total 19ms
I/dalvikvm-heap( 2957): Grow heap (frag case) to 37.150MB for 31961104-byte allocation
D/dalvikvm( 2957): GC_FOR_ALLOC freed 1K, 1% free 37865K/38112K, paused 25ms, total 26ms
D/dalvikvm( 2957): GC_CONCURRENT freed 5K, 1% free 37860K/38112K, paused 3ms+11ms, total 39ms
I/Choreographer( 2957): Skipped 53 frames! The application may be doing too much work on its main thread.
V/StateManager( 1969): destroy
D/dalvikvm( 1969): GC_EXPLICIT freed 1881K, 40% free 3378K/5568K, paused 2ms+3ms, total 29ms
I/InputAttributes( 907): InputType.TYPE_NULL is specified
@brunokruse
brunokruse / DATA
Last active December 11, 2015 07:49
Products_Data
NAME
CATEGORY
SUB_CATEGORY
ISINTERNATIONAL
ISNEW
ISHERO
SIZES
COLORS
FRAME
@brunokruse
brunokruse / gist:4558006
Last active December 11, 2015 06:18
BK Baals Code
// *************************************************************
// BK VERSION
// *************************************************************
void updateBall(){
vMom += gravity;
hMom *= 0.99;
vMom *= 0.99;
@brunokruse
brunokruse / gist:4263831
Created December 12, 2012 00:44
Pipey thing
ofBuffer buffer = ofBufferFromFile("config.txt");
configInfo.clear();
if(buffer.size()) {
while(buffer.isLastLine() == false) {
string line = buffer.getNextLine();
vector<string>elements = ofSplitString(line, "||");
if (elements[0] == "isLocal")
@brunokruse
brunokruse / gist:4191559
Created December 2, 2012 23:26
Downloader
void InstagramManager::downloadNewImages() {
imagesToLoad.clear();
for(int i = 0; i < imageQueue.size(); ++i) {
ofImage* url_img = new ofImage();
imagesToLoad.push_back(url_img);