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
/** | |
* Groovy ASCII Art. Converts an image into ASCII. | |
* This doesn't work under the web console due to missing AWT classes. | |
* | |
* Author : Cedric Champeau (http://twitter.com/CedricChampeau) | |
* Updated : Steven Olsen (http://crazy4groovy.blogspot.com) | |
*/ | |
import java.awt.color.ColorSpace as CS | |
import java.awt.geom.AffineTransform | |
import javax.imageio.ImageIO |
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
/* | |
* author: Steven Olsen | |
* contact: @crazy4groovy, crazy4groovy.blogspot.com | |
* version: 1.2.0 | |
* license: MIT -- no guarantees, can't sue me (!), use it with due credit. | |
*/ | |
(function ($) { $.fn.newsTicker = function (options) { | |
return this.each(function () { |
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
var http = require('http'); | |
http.createServer(function(request, response) { | |
var proxy = http.createClient(80, request.headers['host']) | |
var proxy_request = proxy.request(request.method, request.url, request.headers); | |
proxy_request.addListener('response', function (proxy_response) { | |
proxy_response.addListener('data', function(chunk) { | |
response.write(chunk, 'binary'); | |
}); | |
proxy_response.addListener('end', function() { |
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
window.onload = setScreenClass; // may break $(document).ready()? | |
window.onresize = setScreenClass; | |
// credit: http://www.alistapart.com/articles/switchymclayout | |
// example: http://paulwreid.com/about/ | |
// Following transition classes will be declared: | |
// | |
// classname screenwidth | |
// ------------------------------------------ | |
// pda_ver 240px |
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
/** | |
* see: https://developers.google.com/webfonts/docs/webfont_loader | |
**/ | |
WebFontConfig = { | |
google: { families: [ 'Merriweather', 'Nobile', 'Nobile', 'Nobile'] } | |
}; | |
(function() { | |
var wf = document.createElement('script'); | |
wf.src = '//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; |
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
@Grapes([ | |
@Grab("org.codehaus.geb:geb-junit4:0.6.2"), | |
@Grab("junit:junit-dep:4.8.2"), | |
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.15.0"), | |
@Grab("org.seleniumhq.selenium:selenium-support:2.15.0") | |
]) | |
import geb.Browser | |
Browser.drive { | |
go "http://www.google.ca/" |
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
import java.util.regex.Pattern | |
import java.security.MessageDigest | |
import groovy.io.FileType | |
import groovy.transform.* | |
def input = System.console().&readLine | |
@Field minFileSize | |
@Field maxFileSize | |
String ROOT_DIRS = ( input("Enter the root directory [./] ") ?: "./" ) |
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
I would recommend inserting this code just after the line reading "RewriteEngine On": | |
[Redirect www to non-www] | |
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC] | |
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301] | |
[Redirect non-www to www] | |
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC] | |
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301] |
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
@Grab('org.codehaus.groovyfx:groovyfx:0.1') | |
import groovyx.javafx.GroovyFX | |
import groovyx.javafx.SceneGraphBuilder | |
//source: http://pleasingsoftware.blogspot.ca/2012/03/groovyfx-first-official-release.html | |
//run: groovy -classpath $JAVAFX_HOME/rt/lib/jfxrt.jar helloGroovyFX.groovy | |
GroovyFX.start { | |
def sg = new SceneGraphBuilder() |
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
/* | |
Check if all images are loaded | |
- Callback occurs when all images are loaded | |
- image load errors are ignored (complete will be true) | |
- Use: | |
$('.wrap img').imagesLoaded(function(){ | |
alert('all images loaded'); | |
}); | |
*/ |
OlderNewer