- put
gem stylus
in your Gemfile. - create an empty directory named
node_modules
- run
npm install your-lib
- make an initializer and add this text to it:
Stylus.use('your-lib') if defined?(Stylus)
- make a new stylus file in your
app/assets
folder - use your library
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
_ = require 'lodash' | |
minimatch = require 'minimatch' | |
remove_ignores = (files, ignores) -> | |
mask = [] | |
mask.push _(ignores).map((i) -> minimatch(f.path, i)).contains(true) for f in files | |
files.filter((m, i) -> not mask[i]) |
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
!function(){function t(n,e,i){var r=t.resolve(n);if(null==r){i=i||n,e=e||"root";var s=Error('Failed to require "'+i+'" from "'+e+'"');throw s.path=i,s.parent=e,s.require=!0,s}var o=t.modules[r];return o.exports||(o.exports={},o.client=o.component=!0,o.call(this,o.exports,t.relative(r),o)),o.exports}t.modules={},t.aliases={},t.resolve=function(n){"/"===n.charAt(0)&&(n=n.slice(1));for(var e=n+"/index.js",i=[n,n+".js",n+".json",n+"/index.js",n+"/index.json"],r=0;r<i.length;r++){var n=i[r];if(t.modules.hasOwnProperty(n))return n}return t.aliases.hasOwnProperty(e)?t.aliases[e]:void 0},t.normalize=function(t,n){var e=[];if("."!=n.charAt(0))return n;t=t.split("/"),n=n.split("/");for(var i=0;i<n.length;++i)".."==n[i]?t.pop():"."!=n[i]&&""!=n[i]&&e.push(n[i]);return t.concat(e).join("/")},t.register=function(n,e){t.modules[n]=e},t.alias=function(n,e){if(!t.modules.hasOwnProperty(n))throw Error('Failed to alias "'+n+'", it does not exist');t.aliases[e]=n},t.relative=function(n){function e(t,n){for(var e=t.length;e--;)i |
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
{ | |
"name": "jsrepl", | |
"version": "0.0.1", | |
"author": "replit", | |
"description": "Node adaptation of jsrepl", | |
"main": "repl.js", | |
"repository": { | |
"type": "git", | |
"url": "https://github.com/replit/jsrepl" | |
}, |
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
// routes/auth.js | |
var passport = require('passport') | |
, LocalStrategy = require('passport-local').Strategy; | |
exports.member_auth = function(req, res) { | |
// console.log("Request Body == ", req.body); | |
var strategy = new LocalStrategy({ | |
usernameField: 'email', |
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
# | |
# ruby deps | |
# | |
rbenv_deps: | |
pkg.installed: | |
- names: | |
- git | |
- build-essential | |
- openssl |
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
rbenv-deps: | |
pkg.installed: | |
- pkgs: | |
- bash | |
- git | |
- openssl | |
- gmake | |
- curl | |
ruby-2.0.0-p195: |
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
--- | |
title: 'hello world' | |
--- | |
:markdown | |
blah blah blah |
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
// In this first example, I declare a function with what I call | |
// the 'standard' syntax, which is what I have taught. Because of | |
// this, I can make a call to the function before or after the declaration. | |
say_hello(); // logs 'hello world!' | |
function say_hello(){ | |
console.log('hello world!'); | |
} |