https://travis-ci.com/gitUser/gitRepo/builds/XXXXXX
/** | |
* https://github.com/GoogleChromeLabs/comlink/blob/master/docs/examples/06-node-example/main.mjs | |
* https://github.com/GoogleChromeLabs/comlink/issues/476#issuecomment-642765445 | |
* esModuleInterop to true in tsconfig.json compilerOptions. | |
*/ | |
import { Worker } from 'worker_threads'; | |
import * as comlink from 'comlink'; | |
import nodeEndpoint from 'comlink/dist/umd/node-adapter'; | |
import { cpus } from 'os'; |
#!/usr/bin/env bash | |
function link_stree { | |
ln -s /Applications/SourceTree.app/Contents/Resources/stree /usr/local/bin/ | |
} | |
function install { | |
link_stree | |
} |
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache | |
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache | |
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache | |
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache | |
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# /*########################################################################## | |
# | |
# Copyright (c) 2016 European Synchrotron Radiation Facility | |
# | |
# 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 |
""" | |
topo2geojson.py | |
Convert topojson to geojson | |
Example Usage: | |
python topo2geojson.py data.topojson data.geojson | |
The topojson tested here was created using the mbostock topojson CLI | |
created with --spherical coords and --properties turned on |
Meteor.publish('usersImages',function(groupName){ | |
var collectionName = "user_images"; | |
var subscription = this; | |
group = Groups.findOne({name:groupName}); | |
if(!group) { | |
subscription.stop(); | |
} else { | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"net/http" | |
"github.com/codegangsta/martini" | |
"github.com/garyburd/redigo/redis" | |
"github.com/martini-contrib/render" |
They say that one of the pros of NodeJS is that you use the same language on the back-end and the front-end, so it's easy to share code between them. This sounds great in theory, but in practice the synchronous dependency handling in NodeJS works completely different than any client-side frameworks (which are asynchronous).
Usually that means that you end up copy-pasting your code between your NodeJS sources and your client-side sources, or you use some tool like Browserify, which is brilliant, but they add an extra step in the build process and most likely will conflict with the dependency handling of the framework of your choice (like AnularJS DI). I couldn't look in the mirror if I would call that code sharing.
Fortunately, with a couple of lines of boilerplate code, you can write a module which works in NodeJS and AngularJS as well without any modification.
No globals in the front-end, and dependencies will work. The isNode and isAngular va
// Start `node d3-server.js` | |
// Then visit http://localhost:1337/ | |
// | |
var d3 = require('d3'), | |
http = require('http') | |
http.createServer(function (req, res) { | |
// Chrome automatically sends a requests for favicons | |
// Looks like https://code.google.com/p/chromium/issues/detail?id=39402 isn't | |
// fixed or this is a regression. |