This file contains hidden or 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
| module ActiveSupport::Callbacks::ClassMethods | |
| def without_callback(*args, &block) | |
| skip_callback(*args) | |
| result = yield | |
| set_callback(*args) | |
| return result | |
| end | |
| end |
This file contains hidden or 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
| namespace GLCameraRipple | |
| open System | |
| open System.Drawing | |
| open System.Runtime.InteropServices | |
| //open MonoTouch.CoreFoundation | |
| open Microsoft.FSharp.NativeInterop | |
| type RippleModel(screenSize : Size, meshFactor: int, touchRadius: int, textureSize: Size) = | |
| do Console.WriteLine ("New RippleModel"); | |
| let poolWidth = screenSize.Width / meshFactor |
This file contains hidden or 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
| (* Stand-alone Hello World ServiceStack Web Service with F# on Mono/OSX hosted by HttpListener | |
| Instructions: | |
| 1) download https://github.com/ServiceStack/ServiceStack/downloads | |
| 2) fsharpc -r:ServiceStack.Common.dll -r:ServiceStack.Interfaces.dll -r:ServiceStack.Text.dll -r:ServiceStack.dll Hello.fs | |
| 3) sudo mono Hello.exe | |
| Read More: For the benefits of a ServiceStack Hello World Service see: http://www.servicestack.net/ServiceStack.Hello/ | |
| *) |
This file contains hidden or 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
| require "orbit" | |
| require "orbit.routes" | |
| local R = orbit.routes.R | |
| local hello = orbit.new() | |
| hello:dispatch_get(function (web) | |
| return string.format('<h1>Welcome to %s!</h1>', web.real_path) |
This file contains hidden or 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
| #include <cstdio> | |
| #include <cstdlib> | |
| extern "C" { | |
| #include "lua.h" | |
| #include "lauxlib.h" | |
| #include "lualib.h" | |
| #include "luajit.h" | |
| } |
This file contains hidden or 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.io.File | |
| import javax.imageio.ImageIO | |
| import java.awt.image.BufferedImage | |
| import java.awt.geom._ | |
| import java.awt.Color | |
| import java.awt.Font | |
| import java.awt.Graphics2D | |
| import java.util.Date |
This file contains hidden or 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
| seq 1 1000000 | xargs -n1 -P100 -I{} curl -d "i_answer=1544512" http://pt.fifa.com/theclub/polls/pollId=1544769/staticvote.htmx | |
| # Inspired by https://github.com/vquaiato/better-fifa-raquer |
This file contains hidden or 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
| package main | |
| import ( | |
| "bufio" | |
| "flag" | |
| "os" | |
| "strings" | |
| "launchpad.net/gobson/bson" | |
| "launchpad.net/mgo" | |
| "bytes" |
This file contains hidden or 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
| require 'luarocks.require' | |
| require 'mercury' | |
| require 'haml' | |
| module('fibonacci', package.seeall, mercury.application) | |
| local templates = { | |
| index = [[ | |
| %html | |
| %head |
This file contains hidden or 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
| # as we’re going to use Unicorn as the application server | |
| # we’re not going to use common sockets | |
| # but Unix sockets for faster communication | |
| upstream shop { | |
| # fail_timeout=0 means we always retry an upstream even if it failed | |
| # to return a good HTTP response (in case the Unicorn master nukes a | |
| # single worker for timing out). | |
| # for UNIX domain socket setups: | |
| server unix:/tmp/shop.socket fail_timeout=0; |