Skip to content

Instantly share code, notes, and snippets.

View meza's full-sized avatar
👋
tweet me if I missed a PR

Meza meza

👋
tweet me if I missed a PR
  • London, United Kingdom
  • 15:23 (UTC +01:00)
View GitHub Profile
<div>
<% if @user.loggedin %>
logout
<% else %>
login
<% end %>
</div>
@meza
meza / playground_.gitignore
Created May 10, 2013 16:17
Page load times
# Generated by http://gitignore.io
### Java ###
*.class
# Package Files #
*.jar
*.war
*.ear
@meza
meza / PageLoadTestSteps.java
Last active December 17, 2015 05:09
Page load time testing
package hu.meza;
import cucumber.api.java.After;
import cucumber.api.java.Before;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import net.lightbody.bmp.core.har.Har;
import net.lightbody.bmp.core.har.HarLog;
import net.lightbody.bmp.core.har.HarPage;
import net.lightbody.bmp.proxy.ProxyServer;
private String getCreateContentForm(String contentType) {
if ("article".equals(contentType)) {
return createArticleForm();
}
if ("audio".equals(contentType)) {
return createAudioForm();
}
if ("cartoon".equals(contentType)) {
return createCartoonForm();
Config globalConfig = new Config();
Configuration mainConfigFile = new RequiredConfigurationFile("global.properties");
Configuration devConfigFile = new OptionalConfigurationFile("developer.properties");
globalConfig.add(mainConfigFile);
globalConfig.addOverriding(devConfigFile);
globalConfig.addHighOrder(new SystemPropertiesConfiguration());
Config localConfig = new Config(globalConfig);
@meza
meza / talks.json
Last active December 19, 2015 02:38
A talk box for blogs
[
{
"title":"Agile Testing & BDD Exchange NYC",
"city":"New York",
"url":"http://skillsmatter.com/event/agile-testing/agile-testing-bdd-exchange-nyc-2013",
"date":"2013/09/20 13:15"
},
{
"title":"London Testers Gathering Workshops 2013",
"city":"London",
@meza
meza / gistRender.html
Last active December 21, 2015 07:19
Grab any gist by adding .json to the url, and paste it into the textarea https://gist.github.com/meza/89ac3adecec2ffbc5046.json
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<textarea id="code" rows=15 cols=45></textarea>
<script>
@meza
meza / CalculatorTest.java
Last active August 29, 2015 13:56
Mini-blogpost in response of a twitter correspondence
/**
* Disclamer: This is sort of a rant, but without any negative feelings towards the creators of the project
* in question.
* I value their desire to help people write more readable code, and wish there were more people doing this!
* The only thing I'm questioning is the ever growing trend of tools over craft.
*
* This is a mini blog-post in response to https://twitter.com/hhariri/status/435457449232171008
*
* The reason I have some negative feelings is that writing readable code is not rocket
* science, and with tools like Spek, we're basically allowing people to be ignorant about crafting clean
@meza
meza / Gruntfile.js
Created June 11, 2014 19:46
Example of grunt
grunt.loadNpmTasks('grunt-appcache'); // Handles the appcache
grunt.loadNpmTasks('grunt-contrib-jshint'); // Checks if javascript codes are nice or not
grunt.loadNpmTasks('grunt-contrib-clean'); // Removes generated assets
grunt.loadNpmTasks('grunt-contrib-compass'); // Sass shorthands
grunt.loadNpmTasks('grunt-contrib-copy'); // Copies files
grunt.loadNpmTasks('grunt-contrib-cssmin'); // Minifies CSS
grunt.loadNpmTasks('grunt-contrib-watch'); // Watches for changes and acts on them
grunt.loadNpmTasks('grunt-css-metrics'); // Makes sure we don't overdo css files
#!/bin/sh
#
# Pre-commit hooks
compileResult=0
# Compress stuff before committing
SRC_PATTERN="(\.css|\.scss|\.svg)"
git diff --cached --name-only | if egrep "$SRC_PATTERN"
then
echo "----> Found CSS changes, updating the compressed versions"
node_modules/.bin/grunt