-
Open a browser
# start an instance of firefox with selenium-webdriver driver = Selenium::WebDriver.for :firefox # :chrome -> chrome # :ie -> iexplore
- Go to a specified URL
<?php | |
error_reporting(E_ALL); | |
// 通常の取得 | |
// 配列のキーに値がない場合、Notice: Undefined index が発生します。 | |
$foo = $_GET['foo']; | |
$bar = $_GET['bar']; | |
$baz = $_GET['baz']; |
#!/bin/bash | |
# https://cloud.google.com/compute/docs/faq#find_ip_range | |
# nslookup -q=TXT _cloud-netblocks.googleusercontent.com 8.8.8.8 | |
myarray=() | |
for LINE in `dig txt _cloud-netblocks.googleusercontent.com +short | tr " " "\n" | grep include | cut -f 2 -d :` | |
do | |
myarray+=($LINE) | |
for LINE2 in `dig txt $LINE +short | tr " " "\n" | grep include | cut -f 2 -d :` |
function tableToJson(table) { | |
var data = []; | |
// first row needs to be headers | |
var headers = []; | |
for (var i=0; i<table.rows[0].cells.length; i++) { | |
headers[i] = table.rows[0].cells[i].innerHTML.toLowerCase().replace(/ /gi,''); | |
} | |
// go through cells |
defmodule Common.FinderFunctions do | |
@moduledoc """ | |
Certainly not a perfect replication of Rails' finder methods, but at least gives Rails developers | |
some sense of home with Ecto. This does not reach into associations, nor is it huge-db friendly. | |
## Usage: | |
0. Don't. Just learn Ecto. | |
1. In your given module that implements Ecto's schema, let it | |
`use Common.FinderFunctions, repo: MyApp.Repo`. This also assumes there | |
is a changeset function on your model. |
require 'typhoeus' | |
require 'ethon' | |
resolve = Ethon::Curl.slist_append(nil, "example.com:443:1.2.3.X") | |
r = Typhoeus::Request.new( | |
"https://example.com", | |
resolve: resolve, | |
# verbose: true, | |
) |
Learn to make a fireworks display with HTML5 Canvas and JavaScript. In this demo, the pixel sized rockets launch from the bottom of the screen automatically, and by the click of your mouse. You can also click and drag to launch multiple fireworks.
The tutorial covers keeping track of and looping over objects contained in arrays, tracking mouse clicks and coordinates, animating fireworks to specific target coordinates, and making beautiful particle explosions through the use of randomly generated values.
Feel free to play with the config variables in the JS code to have fun with the experiment.
This was made by: https://twitter.com/jackrugile