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
| package main | |
| import ( | |
| "encoding/json" | |
| "log" | |
| "net/http" | |
| "strconv" | |
| ) | |
| func writeJson(rw http.ResponseWriter, v interface{}) { |
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
| package main | |
| import ( | |
| "encoding/json" | |
| "log" | |
| "net/http" | |
| "strconv" | |
| ) | |
| func writeJson(rw http.ResponseWriter, v interface{}) { |
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
| Nicos-MacBook-Pro:ggbuilds nico$ go build *.go | |
| # command-line-arguments | |
| ./write_json.go:1: missing return at end of function |
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
| - (CGImageRef)thumbnailImageForAsset:(ALAsset *)asset | |
| maxPixelSize:(NSUInteger)size | |
| { | |
| NSParameterAssert(asset != nil); | |
| NSParameterAssert(size > 0); | |
| ALAssetRepresentation *assetRepresentation = [asset defaultRepresentation]; | |
| CGDataProviderDirectCallbacks callbacks = { | |
| .version = 0, |
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
| require 'formula' | |
| # Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook | |
| # PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST! | |
| class Sfml < Formula | |
| homepage 'http://www.sfml-dev.org' | |
| version '2.0' | |
| url 'http://www.sfml-dev.org/download/sfml/2.1/SFML-2.1-sources.zip' |
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
| require 'formula' | |
| # Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook | |
| # PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST! | |
| class Sfml < Formula | |
| homepage 'http://www.sfml-dev.org' | |
| version '2.0' | |
| url 'http://www.sfml-dev.org/download/sfml/2.1/SFML-2.1-sources.zip' |
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
| #include <SDL2/SDL.h> | |
| #include <stdio.h> | |
| const int SCREEN_WIDTH = 640; | |
| const int SCREEN_HEIGHT = 480; | |
| int main(int argc, char* args[]) | |
| { | |
| // Main rendering window | |
| SDL_Window* window = NULL; |
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
| /** | |
| Loads a BMP image into a texture on the rendering device | |
| @param file The BMP image file to load | |
| @param renderer The renderer to load the texture onto | |
| @return the loaded texture, or nullptr if something went wrong. | |
| */ | |
| SDL_Texture *loadTexture(const std::string &file, SDL_Renderer *renderer) | |
| { | |
| SDL_Surface *loadedImage = SDL_LoadBMP(file.c_str()); |
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
| var downloadURL = function(a) { | |
| var b = "hiddenDownloader" + (+new Date()), | |
| c = document.getElementById(b); | |
| null === c && (c = document.createElement("iframe"), c.id = b, c.style.display = "none", document.body.appendChild(c)), c.src = a | |
| }; | |
| window.zips = document.querySelectorAll('a.tutLink[href$=zip]'); | |
| var i = 0; | |
| for (var i; i < window.zips.length; i++) { | |
| var zip = window.zips[i]; | |
| downloadURL(zip.href); |
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
| long colorFromHexString(std::string hexString) | |
| { | |
| return strtol(hexString.c_str(), NULL, 16); | |
| } | |
| std::vector<Uint32> rgbFromColor(long colorValue) | |
| { | |
| std::vector<Uint32> rgb; | |
| // Red, Green, Blue |