Skip to content

Instantly share code, notes, and snippets.

//
// Bookmarklet
//
// Open up the corresponding translation in Japanese or original English article
// in a new window for http://techcrunch.com and http://jp.techcrunch.com
//
// New format:
// Use this regular expression test site: https://regex101.com/
//
// http://jp.techcrunch.com/2017/12/19/2017-12-18-bmw-teams-up-with-solid-power-to-develop-solid-state-batteries-for-cars/
// Euler Project
// Problem 45: https://projecteuler.net/problem=45
package main
import (
"fmt"
)
func main() {
package main
// Euler Project #50: http://projecteuler.net/problem=50
import (
"fmt"
"math"
"runtime"
)
//
// Bookmarklet
//
// Open up the stat page for WordPress.
// You need to be logged in to WordPress.com, and have permission.
//
//
javascript:(function(){
function getFirstElementByClass(matchClass) {
//
// Bookmarklet
//
// Open up the corresponding translation in Japanese or original English article
// in a new window for http://techcrunch.com and http://jp.techcrunch.com
//
javascript:(function(){
_url=location.href;
if(_url.indexOf("http://jp.techcrunch") !== -1) {
_new_url = _url.replace("http://jp.", "https://").replace(/201[0-9\/]+/, "");
$related_tags = {}
qestion_tags = [
%w(ruby rails ide),
%w(rails db),
%w(ruby rails db mysql),
%w(mysql sql),
%w(rails mysql),
%w(ruby rails postgres)
]
$(function(){
var canvas = $("#dragon")[0],
ctx = canvas.getContext("2d");
$.extend(ctx, {
strokeStyle: "rgb(255, 127, 0)",
lineWidth: 1
});
var Turtle = function (x, y, vector) {
@knsmr
knsmr / gist:1354474
Created November 10, 2011 09:10 — forked from hay/gist:1351230
Enterprisify your Java Class Names!
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
background: white;
text-align: center;
padding: 20px;
font-family: Georgia, serif;
@knsmr
knsmr / gist:1218261
Created September 15, 2011 00:56
get number of likes using graph api
require 'open-uri'
require 'json'
def facebook_api
@facebook_api ||= "https://graph.facebook.com/?ids="
end
def retrieve_numbe_of_likes(url)
resp = open(facebook_api+url).read
JSON.parse(resp)[url]["shares"]
@knsmr
knsmr / gist:1216339
Created September 14, 2011 11:19
magic matrix solver
#
# Magic matrix solver
# Ken Nishimura 2011/9/14
#
# Solver.new(Matrix.new((1..9))).solve yeilds:
#
# |8|1|6|
# |3|5|7|
# |4|9|2|
#