Skip to content

Instantly share code, notes, and snippets.

View thom4parisot's full-sized avatar

Thomas Parisot thom4parisot

View GitHub Profile
class Invoker {
invoke() {
return Invoker.convertFromStdin()
}
static async convertFromStdin() {
console.log('>>> convertFromStdin')
const data = await Invoker.readFromStdin()
console.log('<<< convertFromStdin', data)
}
@thom4parisot
thom4parisot / MyAngularCtrl.js
Last active April 19, 2016 11:22 — forked from fcamblor/DataLoader.js
Resolving promise multiple times
'use strict';
angular.module('voxxrin')
.controller('PresentationsCtrl', function ($scope, $stateParams, SharedData) {
Promise.all(SharedData.loadPresentationsForEventPromises($stateParams.eventId)).then(function(presentations){
$scope.presentations = presentations;
});
});
@thom4parisot
thom4parisot / post.md
Last active January 27, 2016 10:25
Apple TV - Sample App

Running the NativeScript Runtime for iOS on Apple TV

Last week Apple announced amongst many new things an update to Apple TV. It now runs on a new operating system named tvOS and includes an app store allowing third-party apps. These apps can be developed using many frameworks and concepts quite familiar to the iOS ones (Foundation, UIKit and CoreGraphics), but also includes some new APIs like TVServices.

We were eager to find out if it was possible to run NativeScript on this new device.

Building the NativeScript Runtime for tvOS

The NativeScript runtime for iOS uses CMake to ease the build configuration process. All we had to do in order to make our build (which includes the JavaScriptCore engine) Apple TV compatible, was to add two more platforms in our config scripts:

set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimul
<style>
#mask_demo {
background: #d0d0d0;
width: 80%;
padding: 10px;
position: relative;
}
/* this may not be a better way to do it, but it is a different way.
it still used the svg for the background on browsers that don't
@thom4parisot
thom4parisot / _gradients.css.scss
Last active July 10, 2020 14:18 — forked from thbar/_gradients.css.scss
Horizontal Gradient Sass Mixin
@mixin horizontal-gradient($from, $to, $stop: 100%) {
/* fallback/image non-cover color */
background-color: $from;
/* Firefox 3.6+ */
background-image: -moz-linear-gradient(left, $from 0%, $to $stop);
/* Safari 4+, Chrome 1+ */
background-image: -webkit-gradient(linear, left top, right top, color-stop(0%, $from), color-stop($stop, $to));
// Chaining API for URIBuilder
var uri = new URLBuilder()
.parse('bad_url_format', loggerErrorHandler)
.addQueryParam('param','value')
.setPort('443')
.toString();
// How to handle the bad url parse error ?
// Don't want to throw exception
@thom4parisot
thom4parisot / update-route53-dns.sh
Created November 15, 2012 11:49 — forked from dfox/update-route53-dns.sh
A script to update DNS on Route 53
#!/bin/sh
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Load configuration
. /etc/route53/config