Skip to content

Instantly share code, notes, and snippets.

@Phrogz
Phrogz / LICENSE.md
Last active October 4, 2017 18:47 — forked from ganezasan/LICENSE.md
Day / Hour Heatmap in v4

Copyright (c) 2016, Tom May

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTH

index 0dd8c96..b28aebf 100644
--- a/platform/qt/qmlapp/main.cpp
+++ b/platform/qt/qmlapp/main.cpp
@@ -1,5 +1,3 @@
-#include <QMapbox>
-
#include <QGuiApplication>
#include <QIcon>
#include <QQmlApplicationEngine>
@@ -13,10 +11,6 @@ int main(int argc, char *argv[])
TEMPLATE = app
QT += qml quick
CONFIG += c++11
SOURCES += main.cpp
RESOURCES += qml.qrc
INSTALL_DIR = $$PWD/../install
target.path = $$INSTALL_DIR
# Copy the QQuickMapboxGL folder to the install directory
@Phrogz
Phrogz / gist:079c45bc73ea536176f21d0e6f48e7a0
Created November 15, 2016 17:43
Build errors attempting to compile QQuickMapboxGL
gkistner@gkistner-dt3:/var/git/mapbox-gl-native$ make qt-qml-app
npm update # Install dependencies but don't run our own install script.
npm http GET https://registry.npmjs.org/node-pre-gyp
npm http 304 https://registry.npmjs.org/node-pre-gyp
npm http GET https://registry.npmjs.org/node-pre-gyp/0.6.31
npm http 304 https://registry.npmjs.org/node-pre-gyp/0.6.31
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/rc
npm http GET https://registry.npmjs.org/npmlog
@Phrogz
Phrogz / .block
Last active November 12, 2016 01:48 — forked from mbostock/.block
Histogram
license: gpl-3.0
@Phrogz
Phrogz / Makefile
Created August 28, 2016 16:11
Qt QML Makefile generated by qmake
#############################################################################
# Makefile for building: qt-client
# Generated by qmake (3.0) (Qt 5.2.1)
# Project: qt-client.pro
# Template: app
# Command: /usr/lib/x86_64-linux-gnu/qt5/bin/qmake -spec linux-g++ -o Makefile qt-client.pro
#############################################################################
MAKEFILE = Makefile
# Benchmarking answers to http://stackoverflow.com/questions/9333952/in-ruby-how-to-make-the-string-include-method-ignore-case/9334066
# http://www.gutenberg.org/cache/epub/1661/pg1661.txt
strings = IO.read('sherlock.txt').scan(/\w+/) # 109,222 words
known = 500.times.map do
strings.sample.downcase.chars.map{ |c| rand<0.5 ? c.upcase : c }.join
end
words = known.flat_map{ |s| [s, s+"-"] } # \w does not include -
@Phrogz
Phrogz / index.html
Created January 14, 2016 22:18
Faye + Sinatra inside EventMachine
<!DOCTYPE html>
<html lang='en'><head>
<meta charset='utf-8'>
<title>RB3Jay</title>
<script src='/jquery.min.js'></script>
<script src='/rb3jay.js'></script>
<script src='/faye/client.js'></script>
</head><body>
<div id='playing'>
@Phrogz
Phrogz / simpleinheritance.rb
Last active January 21, 2017 13:55
Showing that a sub-class need not have an #initialize method
class Person
attr_reader :firstname, :lastname
def initialize( first, last )
@firstname, @lastname = first, last
end
def say_hi
puts "Hello, my name is #{@firstname} #{@lastname}"
end
end
# Returns a hash mapping image paths to arrays of the assets referencing them
def image_usage
{}.tap do |usage|
asset_types = app.metadata.by_name.values + @class_by_ref.values
image_properties_by_type = asset_types.flat_map do |type|
type.properties.values
.select{ |property| property.type=='Image' || property.type == 'Texture' }
.map{ |property| [type,property] }
end.group_by(&:first).tap{ |x| x.each{ |t,a| a.map!(&:last) } }