# You might have to sudo
npm install -g html2jadeTry out the html2jade command. For example, with some HTML in your clipboard, do this in the shell:
| puts (1..100).map { |n| | |
| w = [ | |
| ('Fizz' if n % 3 == 0), | |
| ('Buzz' if n % 5 == 0) | |
| ] | |
| .uniq() | |
| .compact() | |
| .join('') | |
| w.empty? ? n : w |
| function tapeEquilibrium(A) { | |
| var p, idx; | |
| var leftSum = 0, rightSum = 0; | |
| var totalSum = 0; | |
| var lastMin, currentMin; | |
| var N = A.length; | |
| if (N == 2) { return Math.abs(A[0] - A[1]); } | |
| if (N == 1) { return Math.abs(A[0]); } | |
| function toInt(value) { | |
| return ~~value; | |
| } | |
| function minFrogJumps(X, Y, D) { | |
| var a = Y / D; | |
| var b = X / D; | |
| return toInt(Math.ceil(a -b)); | |
| } |
| group :development, :test do | |
| gem 'dotenv-rails', :require => 'dotenv/rails-now' | |
| # Call 'byebug' anywhere in the code to stop execution and get a debugger console | |
| gem 'byebug' | |
| # Access an IRB console on exception pages or by using <%= console %> in views | |
| gem 'web-console', '~> 2.0' | |
| # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring |
brew install nginx
sudo cp /usr/local/Cellar/nginx/1.8.0/homebrew.mxcl.nginx.plist /Library/LaunchAgentsReplace /usr/local/etc/nginx/nginx.conf with the nginx.conf in this gist. I'm using port 5000 for my current project. Obviously, change server_name as well, and probably the name of its access log.
| bl_info = { | |
| "name": "Edge sum", | |
| "author": "zeffii", | |
| "version": (0, 1, 0), | |
| "blender": (2, 6, 1), | |
| "location": "3d view, N panel", | |
| "description": "Adds edge sum box to Mesh Display.", | |
| "wiki_url": "", | |
| "tracker_url": "", | |
| "category": "3D View"} |
After installing keypress (npm install keypress), running this in the Node REPL will show you what the names an codes are for different keypresses.
var keypress = require('keypress');
// make `process.stdin` begin emitting "keypress" events
keypress(process.stdin);
// listen for the "keypress" event
process.stdin.on('keypress', function (ch, key) {| # _EMPTY_STRING_ | |
| # The -n operator checks whether the string is not null. Effectively, this will | |
| # return true for every case except where the string contains no characters. ie: | |
| VAR="hello" | |
| if [ -n "$VAR" ]; then | |
| echo "VAR is not empty" | |
| fi | |
| # Similarly, the -z operator checks whether the string is null. ie: | |
| VAR="" | |
| if [ -z "$VAR" ]; then |