Skip to content

Instantly share code, notes, and snippets.

View maxidr's full-sized avatar

Maxi Dello Russo maxidr

  • mxHero
  • Buenos Aires, Argentina
  • X @maxidr
View GitHub Profile
'use strict';
var m = require('mithril');
var t = require('client/utils/translate');
var vagueTime = require('vague-time');
var l16n = require('client/utils/l16n');
function assignValue(obj, objAttr) {
return function (event) {
@corbanb
corbanb / dev-node.md
Last active June 1, 2021 13:49
OSX 10.10.X Node Developer Setup

Node.js + OSX 10.10.X

Outline

Below is a quick start guide to developing node.js on OSX. These tools and settings will give you just about everything you would need on a clean install of OSX 10.10.X to get setup and coding.

Install iTerm2

https://www.iterm2.com

Install XCode

@mattdesl
mattdesl / README.md
Last active August 29, 2015 14:17
web app workflow with npm run

npm run scripts to handle the following:

  • LESS for CSS pre-processor
  • browserify for npm dependencies
  • watchify for fast incremental bundling
  • LiveReload browser refresh on bundle change
  • LiveReload CSS injection on *.less change
  • budo to serve port 9966 and bring together some of the above tasks
  • babelify for ES6 -> ES5
  • errorify to show syntax errors in the browser during development
@gilbert
gilbert / widget.js
Created March 25, 2015 17:09
Mithril + JSS
Widget = {
controller: function () {
this.css = Widget.stylesheet().classes
},
view: function (ctrl) {
return m('.widget', [
m('h3', { class: ctrl.css.head }),
m('div', { class: ctrl.css.body })
])
},
@StephanHoyer
StephanHoyer / inlineedit.js
Last active October 13, 2015 16:46
Inline edit mithril component
'use strict';
var m = require('mithril');
var extend = require('lodash').extend;
var setFocus = require('../util/viewhelper').setFocus;
var keymage = require('keymage');
function noop(){}
function addClass(el, className) {
@barneycarroll
barneycarroll / mithril.utils.js
Last active August 26, 2016 13:52
Mithril toolbelt
// Mithril utilities
// Multi allows you to execute multiple functions as one.
// Especially useful when you want to bind several event handlers
// or run several config functions, for example binding a DOM plugin
// & assigning routing to a link.
//
// m( 'a.select2', {
// config : multi( m.route, select2plugin )
// }, [] );
@StephanHoyer
StephanHoyer / oojs.md
Last active October 13, 2015 16:45
Object orientation without new and the in JavaScript

Just saw Douglas Crockfords talk at Craft Conference

http://www.ustream.tv/recorded/46640057

Just tried it and must say, it has a certain beauty in it.

No tangeling with prototypes and this/that fuckup.

var Animal = function(name, legs) {
@TooTallNate
TooTallNate / mp3player.js
Created October 24, 2012 17:42
node.js command line MP3 player in 9 lines of code!
var fs = require('fs');
var lame = require('lame');
var Speaker = require('speaker');
fs.createReadStream(process.argv[2])
.pipe(new lame.Decoder())
.on('format', function (format) {
this.pipe(new Speaker(format));
});
@maxidr
maxidr / env.yml
Created October 11, 2012 13:28
Allows you to set environment variables in a YAML file at config/env.yml (from http://railswizard.org of intridea)
# in config/env.yml
defaults: &defaults
ENV_YAML: true
development:
<<: *defaults
test:
<<: *defaults
@matflores
matflores / gist:3692524
Created September 10, 2012 17:53
Fixing conflicts between Ghostscript & gs

Fixing conflicts between Ghostscript & gs

If you are using gs for managing your gem sets and you are also using any tool that relies on Ghostscript for converting PDF files to other formats (e.g. GraphicsMagick, docsplit, etc.), you may find that one of the two will fail due to a conflict between the two gs commands.

There are two possible solutions to this problem:

  • rename the gs command to something else (e.g. gset, gs_, etc), and leave Ghostscript's gs as the only gs command in your system.
  • edit GraphicMagick's delegates file and specify the full path to the gs command. This file is located in the lib/GraphicsMagick/config directory of your GraphicsMagick's installation. If GraphicsMagick was installed via homebrew, you can find the full path to this file by running brew list graphicsmagick | grep delegates.