Skip to content

Instantly share code, notes, and snippets.

@swilcox
swilcox / _mgraph.md
Last active Oct 6, 2017
Multi-graph example widget for Shopify's Dashing dashboard
View _mgraph.md

Multi-graph widget for Dashing

Description

Multi-graph widget for Shopify's dashing to display a comparison style graph (or stacked with a minor modification). Obviously, this is an example that is built heavily on the existing graph widget that is provided with dashing. This widget provides a more clear framework for expanding the graph for multiple series (or nodes) of data. After seeing the example code, it should be fairly easy to expand to 3 or more overlaid graphs (although colors might get tricky). And really, this is just a slightly greater use of the cool rickshaw graphs.

To use this widget:

@P7h
P7h / ReadPropertiesWithGuava.java
Last active Sep 5, 2019
Load a properties file using Guava.
View ReadPropertiesWithGuava.java
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;
import com.google.common.io.ByteSource;
import com.google.common.io.Resources;
/**
* Reads a properties file and print all the key value pairs to the console.
View gist:8831568
<activity
android:name=".DangerousActivity"
android:label="@string/app_name"
android:permission="course.labs.permissions.DANGEROUS_ACTIVITY_PERM" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
@rondinif
rondinif / gist:9058989
Created Feb 17, 2014
Debugging Mobile Chrome using Desktop Chrome via ADB port forwarding.
View gist:9058989
adb forward tcp:9222 localabstract:chrome_devtools_remote
@renatomattos2912
renatomattos2912 / unzip tar.gz
Created Mar 3, 2014
Unzip tar.gz on mac from terminal
View unzip tar.gz
gunzip -c foo.tar.gz | tar xopf -
@iksose
iksose / restAPI.markdown
Last active Mar 18, 2021
Creating a REST API using Node.js, Express, and MongoDB
View restAPI.markdown

###Creating a REST API using Node.js, Express, and MongoDB

####Installing Node.js

Go to http://nodejs.org, and click the Install button. Run the installer that you just downloaded. When the installer completes, a message indicates that Node was installed at /usr/local/bin/node and npm was installed at /usr/local/bin/npm. At this point node.js is ready to use. Let’s implement the webserver application from the nodejs.org home page. We will use it as a starting point for our project: a RESTful API to access data (retrieve, create, update, delete) in a wine cellar database.

Create a folder named nodecellar anywhere on your file system. In the wincellar folder, create a file named server.js.

@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active Sep 17, 2021
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew
View fix-homebrew-npm.md

READ THIS Very Important Update

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@susielu
susielu / README.md
Created Mar 13, 2014
Gephi + d3.js. Fixed network, dynamic labels.
View README.md

This example creates a fixed network graph with dynamic labels using d3.js. The network layout and placement of the nodes and edges was calculated in Gephi and then exported as the graph.json file.

This was inspired from these gists by Mike Bostock: Force-Directed Graph, Multi-Foci Force Layout

@ryanj
ryanj / .openshift\action_hooks\pre_build_nodejs
Last active May 24, 2016
Include support for packaging globally installable npm modules, or other executables, locally within a project's source (node_modules/.bin/)
View .openshift\action_hooks\pre_build_nodejs
#!/bin/bash
# Projects which rely on npm modules which are normally installed using "npm install -g"
# can make those dependencies available on OpenShift by including this file in their project source.
# Add this content to your project as ".openshift/action_hooks/pre_build_nodejs"
# Then, save your npm dependencies locally (without the '-g' flag):
# > npm install module_name --save
# Finally, add and commit your changes:
View DemoDocumentProvider
/***
Copyright (c) 2014 CommonsWare, LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License.