pets = %w[dog cat rabbit]
puts "My first pet is a %s, my second one a %s and my third is a %s" % pets
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 me = new Object(); | |
var directionsService = new google.maps.DirectionsService(); | |
var directionsDisplay; | |
function calcRoute() { | |
directionsDisplay = new google.maps.DirectionsRenderer(); | |
directionsDisplay.setMap(mapaGlobal); |
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
// npm i google-maps | |
import GoogleMapsLoader from 'google-maps'; | |
GoogleMapsLoader.KEY = 'AIzaSyA9aGnRJDU1DRIXl5urposeU0p6qXr0LWM'; | |
GoogleMapsLoader.LIBRARIES = [ | |
// ルート描画に必要 | |
'places' | |
]; |
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>Document</title> | |
<style> | |
html, body { | |
margin: 0; | |
padding: 0; | |
width: 100%; |
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
Model.find({}, [], {'group': 'FIELD'}, function(err, logs) { | |
// code | |
}); |
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 app = angular.module('app', ['ngResource']); | |
app.config(function($locationProvider, $routeProvider) { | |
// $locationProvider.html5Mode(true); | |
$routeProvider | |
.when('/', { templateUrl: 'partials/index', controller: 'ctrl' }) | |
.when('/about', { templateUrl: 'partials/about', controller: 'ctrl' }) | |
.otherwise({redirectTo:'/'}); | |
}); |
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
<?php | |
date_default_timezone_set('Asia/Bangkok'); | |
require_once "lib/nusoap.php"; | |
// Create SOAP Server | |
$server = new soap_server(); | |
$server->configureWSDL("Test_Service", "http://www.example.com/test_service"); | |
// Example "hello" function | |
function hello($username) { |
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
<?php | |
function encriptar($texto){ | |
$key='palabraclaveparalacodificacionydecodificacion'; // Una clave de codificacion, debe usarse la misma para encriptar y desencriptar | |
$encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $cadena, MCRYPT_MODE_CBC, md5(md5($key)))); | |
return $encrypted; | |
}; | |
function desencriptar($texto){ |
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 passport = require('passport'), | |
FacebookStrategy = require('passport-facebook').Strategy, | |
TwitterStrategy = require('passport-twitter').Strategy, | |
GithubStrategy = require('passport-github').Strategy, | |
GoogleStrategy = require('passport-google-oauth').OAuth2Strategy; | |
/* ...server setup... */ | |
// Setup passport auth | |
app.use(passport.initialize()); |
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') | |
, passport = require('passport') | |
, LocalStrategy = require('passport-local').Strategy | |
, mongodb = require('mongodb') | |
, mongoose = require('mongoose') | |
, bcrypt = require('bcrypt') | |
, SALT_WORK_FACTOR = 10; | |
mongoose.connect('localhost', 'test'); | |
var db = mongoose.connection; |