Skip to content

Instantly share code, notes, and snippets.

@beresmate
beresmate / testgist.php
Created February 7, 2011 20:50
Hello World
<?php
dsm("Hello World!");
function myFunction($node){
print $node->title;
}
?>
@beresmate
beresmate / nodemplayertest.js
Created November 17, 2012 19:14
node and mplayer playback
var cp = require('child_process');
var connect = require('connect');
var command = 'mplayer.exe track.mp3';
var app = connect()
.use(connect.favicon())
.use(function(req, res){
cp.exec(command, {}, function(err, stdout, stderr) {
define([
'class1',
'class2',
// non-returning modules
'jqueryplugin1',
'jqueryplugin2'
], function (
Class1,
Class2
var myApp = new Backbone.Marionette.Application();
var childModuleName = 'MainModule';
myApp.module(childModuleName, MainModule);
function MainModule (module, parent, Backbone, Marionette, $, _) {
var childModuleName = this.moduleName + '.foo';
this.app.module(childModuleName, Foo, childModuleName);
function Foo (module, parent, Backbone, Marionette, $, _, moduleName) {
@beresmate
beresmate / hint.js
Last active December 25, 2015 08:49
// https://github.com/gawkermedia/kinja-mantle/blob/grunt-soy/build/mantle.js#L51
jsFilesExceptLib: function () {
return global.mantle.getCachedList('jsFilesExceptLib.txt', function () {
//return _.map(_.filter(grunt.file.expand({..
});
}
// https://github.com/gruntjs/grunt/wiki/grunt.file#gruntfileexpand
// This method accepts either comma separated globbing patterns or an array of globbing patterns.
// Paths matching patterns that begin with ! will be excluded from the returned array.
/* global module, require */
(function () {
'use strict';
var library = require('./../app/controllers/library'),
views = require('./../app/controllers/views'),
_ = require('lodash');
module.exports = function (app, io) {
/* global module, require */
(function () {
'use strict';
var library = require('./../app/controllers/library'),
views = require('./../app/controllers/views'),
_ = require('lodash');
module.exports = function (app, io) {
/* global module, require */
(function () {
'use strict';
var library = require('./../app/controllers/library'),
views = require('./../app/controllers/views'),
_ = require('lodash');
module.exports = function (app, io) {
2013-11-22 17:11:40.431:WARN:osjs.ServletHandler:Error for /grid/resources/images/console-beta.css
java.lang.Error: Cannot find resource images/console-beta.css
at org.openqa.grid.web.servlet.ResourceServlet.process(ResourceServlet.java:58)
at org.openqa.grid.web.servlet.ResourceServlet.doGet(ResourceServlet.java:48)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.seleniumhq.jetty7.servlet.ServletHolder.handle(ServletHolder.java:565)
at org.seleniumhq.jetty7.servlet.ServletHandler.doHandle(ServletHandler.java:479)
at org.seleniumhq.jetty7.server.session.SessionHandler.doHandle(SessionHandler.java:225)
at org.seleniumhq.jetty7.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
@beresmate
beresmate / parallel-test-task.js
Last active May 12, 2016 18:17
Run mocha processes parallel from a Grunt task.
module.exports = function (grunt) {
// collect the test files from our test folder
// for example grunt.file.expand
function getTests () {
var tests = [
{
filePath: '/Users/Mate/Desktop/LoginTest.js',
name: 'Login test'
},
{