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 org.grooscript.asts.GsNative | |
class Faker { | |
private _faker | |
@GsNative | |
private faker() {/* | |
if (!this._faker) { | |
this._faker = require('faker'); | |
} |
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
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style type="text/css"> | |
body { | |
min-height: 2000px; | |
} | |
.book { |
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 static groovy.json.JsonOutput.* | |
def config = ['test': 'lalala'] | |
println prettyPrint(toJson(config)) |
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
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] |