Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.
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
var crosswalk = { | |
folder: { | |
arm: 'tools/crosswalk-cordova-7.36.154.13-arm', | |
x86: 'tools/crosswalk-cordova-7.36.154.13-x86' | |
} | |
}; | |
// https://crosswalk-project.org/#documentation/cordova/migrate_an_application | |
var addCrosswalk = { | |
command: [ |
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
var dbus = require('dbus-native'); | |
var bus = dbus.systemBus(); | |
udservice = bus.getService('org.freedesktop.UDisks'); | |
udservice.getInterface( | |
'/org/freedesktop/UDisks', | |
'org.freedesktop.UDisks', | |
function(err, ud) { | |
ud.on('DeviceAdded', function(deviceObjectPath) { | |
console.log('DeviceAdded', deviceObjectPath); | |
}); |
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
// Vertical gradient using CSS where possible, and base64-encoded SVG for IE9 (enables use of this in combination with border-radius) | |
// Based on this by Phil Brown: http://blog.philipbrown.id.au/2012/09/base64-encoded-svg-gradient-backgrounds-in-less/ | |
// Also based on a mixin from Twitter Bootstrap: https://github.com/twitter/bootstrap | |
.gradient-vertical(@startColor, @endColor) { | |
// IE9 prep | |
@dataPrefix: ~"url(data:image/svg+xml;base64,"; | |
@dataSuffix: ~")"; | |
@dataContent: ~'<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none"><linearGradient id="g743" gradientUnits="userSpaceOnUse" x1="0%" y1="0%" x2="0%" y2="100%"><stop stop-color="@{startColor}" offset="0"/><stop stop-color="@{endColor}" offset="1"/></linearGradient><rect x="0" y="0" width="1" height="1" fill="url(#g743)"/></svg>'; |
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
#!/bin/sh | |
#create meteor project | |
mrt create "$1" | |
#revise priors | |
sudo rm "$1".js | |
sudo rm "$1".html | |
sudo rm "$1".css |
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
var connect = Npm.require('connect'); | |
RoutePolicy.declare('/my-uploaded-content', 'network'); | |
// Listen to incoming http requests | |
WebApp.connectHandlers.use('/my-uploaded-content', connect.static(process.env['APP_DYN_CONTENT_DIR'])); |
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
#!/bin/bash | |
# | |
# Starts up a MongoDB replica set | |
# | |
# There is a lot of documentation about replica sets: | |
# | |
# http://docs.mongodb.org/manual/reference/replica-configuration/ | |
# http://docs.mongodb.org/manual/administration/replica-sets/ | |
# | |
# To read data from a SECONDARY, when in the client, use: |
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
### | |
Copyright (c) 2012 rhoot <https://github.com/rhoot> | |
This software is provided 'as-is', without any express or implied | |
warranty. In no event will the authors be held liable for any damages | |
arising from the use of this software. | |
Permission is granted to anyone to use this software for any purpose, | |
including commercial applications, and to alter it and redistribute it | |
freely, subject to the following restrictions: |
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
//top-level imports | |
import React from 'react'; | |
import shallowCompare from 'react-addons-shallow-compare' | |
import { Link } from 'react-router'; | |
//npm components | |
import { List, AutoSizer, InfiniteLoader } from 'react-virtualized'; | |
// Material-UI | |
import {Card, CardActions, CardHeader, CardText} from 'material-ui/Card'; | |
import Avatar from 'material-ui/Avatar'; | |
//modules |
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
const obj = { a: 1, c: 3, b: 2 } | |
// Map from object. | |
const myMap = new Map(Object.entries(obj)) | |
// Map to Object. | |
// NOTE: Keys will be cast to strings by `.toString`, so any "complex" key like for example `[1, 2]` will become `1,2` | |
const newObj = [...myMap.entries()] | |
.reduce((acc, [key, value]) => (Object.assign(acc, { [key]: value })), {}) |
OlderNewer