irb: rand(10..30) # create a random between a range
$ gem install awesome_print
irb: require 'ap'; ap [0,1,2]
x = 'string'; x['st'] # => 'st'
include A, B, C # include multiple modules in one line
| import com.badlogic.gdx.Gdx; | |
| import com.badlogic.gdx.Screen; | |
| import com.badlogic.gdx.graphics.GL10; | |
| import com.badlogic.gdx.graphics.OrthographicCamera; | |
| import com.badlogic.gdx.math.Matrix4; | |
| import com.badlogic.gdx.math.Vector2; | |
| import com.badlogic.gdx.physics.box2d.Body; | |
| import com.badlogic.gdx.physics.box2d.BodyDef; | |
| import com.badlogic.gdx.physics.box2d.BodyDef.BodyType; | |
| import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer; |
| (function() { | |
| Entities.Bullet = me.ObjectEntity.extend({ | |
| init: function(x, y, settings) { | |
| this.tx = settings.tx; | |
| this.ty = settings.ty; | |
| settings.image = "bullets"; | |
| settings.spritewidth = 16; | |
| settings.spriteheight = 16; | |
| this.width = 16; |
| <style type="text/css"> | |
| body { | |
| transform:rotate(180deg); | |
| -webkit-transform: rotate(180deg); | |
| -moz-transform:rotate(180deg); | |
| -ms-transform:rotate(180deg); | |
| -o-transform:rotate(180deg); | |
| } | |
| </style> |
| (function() { | |
| Ajax.Responders.register({ | |
| onCreate: function(request) { | |
| var token = $$('meta[name=csrf-token]')[0]; | |
| if (token) { | |
| if (!request.options.requestHeaders) request.options.requestHeaders = {}; | |
| request.options.requestHeaders['X-CSRF-Token'] = token.readAttribute('content'); | |
| } | |
| } | |
| }); |
| var sys = require("sys"), | |
| my_http = require("http"), | |
| path = require("path"), | |
| url = require("url"), | |
| filesys = require("fs"); | |
| my_http.createServer(function(request,response){ | |
| var my_path = url.parse(request.url).pathname; | |
| var full_path = path.join(process.cwd(),my_path); | |
| path.exists(full_path,function(exists){ | |
| if(!exists){ |
| require 'csv' | |
| require 'net/http' | |
| responses = [] | |
| CSV.foreach(ARGV[0]) do |row| | |
| responses << "#{row},#{Net::HTTP.get_response(URI.parse(row[0]))}" | |
| puts row | |
| end | |
| IO.write("url_responses.csv", responses.join("\n")) |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title></title> | |
| <meta name="viewport" content="width=device-width, minimum-scale=1.0" /> | |
| <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
| </head> | |
| <body> | |
| </body> |
| require 'benchmark' | |
| arr = [ | |
| ] | |
| Benchmark.bm do |x| | |
| x.report 'class check' do | |
| 100.times.each do |i| | |
| 100_000.times.each do |j| |
| ig.module( | |
| 'plugins.touch-button' | |
| ) | |
| .requires( | |
| 'impact.system', | |
| 'impact.input', | |
| 'impact.image' | |
| ) | |
| .defines(function(){ |