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
... | |
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSAllowsArbitraryLoads</key> | |
<true/> | |
</dict> | |
... |
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
ArrayList<GData> getNorthGaussBits() { | |
ArrayList<GData> northGaussBits = new ArrayList<GData>(); | |
if (wsData != null) { | |
JSONArray gaussBits = JSONObject.parse(wsData).getJSONArray("northGaussBits"); | |
for(int i=0; i<gaussBits.size(); i++) { | |
JSONObject gb = gaussBits.getJSONObject(i); | |
northGaussBits.add(new GData(gb.getFloat("x")*width, gb.getFloat("y")*height, gb.getFloat("intensity"), gb.getFloat("angle"), gb.getFloat("pitch"))); | |
} | |
} | |
return northGaussBits; |
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
function line(x1, y1, x2, y2) { | |
game.debug.context.beginPath(); | |
game.debug.context.moveTo(x1, y1); | |
game.debug.context.lineTo(x2, y2); | |
game.debug.context.stroke(); | |
} | |
function getTrajectoryPoint(startX, startY, velocityX, velocityY, n) { |
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 Ball { | |
float x; | |
float y; | |
int size; | |
PVector v; | |
color c; | |
Ball(float x, float y, int size) { | |
this.x = x; | |
this.y = 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
#!/usr/bin/env ruby | |
require "openssl" | |
require 'digest/sha2' | |
require 'base64' | |
# We use the AES 256 bit cipher-block chaining symetric encryption | |
alg = "AES-256-CBC" | |
# We want a 256 bit key symetric key based on some passphrase | |
digest = Digest::SHA256.new |
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 ApiLogger < Grape::Middleware::Base | |
def before | |
Rails.logger.info "[api] Requested: #{request_log_data.to_json}\n" + | |
"[api] #{response_log_data[:description]} #{response_log_data[:source_file]}:#{response_log_data[:source_line]}" | |
end | |
private | |
def request_log_data |
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
package main | |
import ( | |
eventsource "github.com/antage/eventsource/http" | |
redis "github.com/vmihailenco/redis" | |
"log" | |
"net/http" | |
) | |
func haltOnErr(err error){ |
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
/* | |
Chrome Packaged app Bluetooth API test | |
Before interacting with a BT device, you need to : | |
1) get the device MAC and service UUID with startDiscovery and getServices methods | |
2) request permission with chrome.permissions.request | |
3) add the service profile with chrome.bluetooth.addProfile (a profile is only {uuid:'xxxxxxx...'}) | |
*/ | |
// onConnection callback | |
chrome.bluetooth.onConnection.addListener( |
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
// in setupMesh function | |
if(!meshTemp.checkLargeTriangle((*triangles)[i])) { | |
spineEdgeSet = meshTemp.getSkeletonPointSet(*meshTemp.ps); | |
spineEdgeSet = meshTemp.getSimplifiedPointEdgeSet(spineEdgeSet); | |
} |
NewerOlder