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
x.map do |y| | |
puts "^^ #{y} ^^" | |
end |
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"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Selecting text via API</title> | |
</head> | |
<body> | |
<div><span id="s1">ABCDEFGHI</span><span id="s2">12345</span></div> | |
<script> | |
var span = document.getElementById("s1"); |
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 mysql = require('mysql'); | |
var Q = require("q"); | |
function createConnection() { | |
var conn = mysql.createConnection({ | |
host : 'localhost', | |
user : 'root', | |
password : 'password', | |
database : 't2' | |
}); |
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
substr :: [Char] -> Int -> Int -> [Char] | |
substr str start end = | |
let length' = end - start | |
in (take length' (drop start str)) | |
main = do | |
x <- readFile "u8.txt" | |
putStrLn (substr x 3 8) |
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
'use strict'; | |
describe('StreeCorrCreator', function() { | |
var streeCorrCreator; | |
beforeEach(function() { | |
module('annotedw'); | |
inject(function($injector) { | |
streeCorrCreator = $injector.get('StreeCorrCreator'); | |
}); |
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
$ B2G_SYSTEM_APPS=1 make install-gaia | |
test -d profile || mkdir -p profile | |
run-js-command applications-data | |
Looking for packaged app: /Users/vee/Develop/gaia/external-apps/marketplace.firefox.com/update.webapp | |
run-js-command preferences | |
make[1]: Nothing to be done for `concatenated_scripts'. | |
make[1]: Nothing to be done for `concatenated_scripts'. | |
Finished: bootstrapping test proxies/sandboxes | |
Finished: test ui config file: ./test_apps/test-agent/config.json |
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
require 'json' | |
require 'pp' | |
PP.pp JSON.parse($stdin.read) |
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 express = require('express'); | |
var app = express(); | |
var nconf = require('nconf'); | |
var Q = require("q"); | |
var crypto = require('crypto'); | |
app.use(express.bodyParser()); | |
app.post("/user/auth", function(req, res) { | |
res.set('Content-Type', 'application/json'); | |
authUser(req.body.username, req.body.password).then(function(auth_result) { |
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 express = require('express'); | |
var app = express(); | |
var Db = require('mongodb').Db, | |
MongoClient = require('mongodb').MongoClient, | |
ObjectID = require('mongodb').ObjectID, | |
GridStore = require('mongodb').GridStore; | |
app.get("/myimage.png", function(req, res) { | |
MongoClient.connect("mongodb://localhost:27017/mydb", function(err, db_) { |
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
package main; | |
import ( | |
"fmt" | |
"unicode/utf8" | |
) | |
func main() { | |
s := "กา" | |
fmt.Println(len(s), utf8.RuneCountInString("กา")) |
OlderNewer