Skip to content

Instantly share code, notes, and snippets.

configS2 = {
"_id" : "s2",
"members" : [
{
"_id" : 1,
"host" : "localhost:47017"
},
{
"_id" : 2,
"host" : "localhost:47018"
MongoDB shell version: 2.6.3
connecting to: 127.0.0.1:61017/test
type "help" for help
--- Sharding Status ---
sharding version: {
"_id" : 1,
"version" : 4,
"minCompatibleVersion" : 4,
"currentVersion" : 5,
"clusterId" : ObjectId("53a96331481074c25a3fd0d8")
<!DOCTYPE html>
<html>
<head>
<script src="http://jasmine.github.io/2.0/lib/jasmine.js" type="text/javascript">
<script src="http://jasmine.github.io/2.0/lib/jasmine-html.js" type="text/javascript">
<script src="http://jasmine.github.io/2.0/lib/boot.js" type="text/javascript">
<link href="http://jasmine.github.io/2.0/lib/jasmine.css" type="text/css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular.js" type="text/javascript">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular-mocks.js" type="text/javascript">
<!-- add your js resources here -->
(function () {
angular.module('myApp', []);
var myCtrl = function ($scope) {
console.log("declare myCtrl");
$scope.itWasUsed = false;
$scope.myvalue = 'value initial';
$scope.useIt = function () {
console.log("call real useIt function");
$scope.itWasUsed = true;
var myService = function($http, $q, $timeout) {
this.doItAsync = function() {
var deferred = $q.defer();
...
return deferred.promise;
};
};
angular.module('global.services', []);
myService.$inject = ['$http', '$q', '$timeout'];
var unique = require('uniq');
var data = [1, 2, 2, 3, 4, 5, 5, 5, 6];
console.log(unique(data));
@asicfr
asicfr / index.js
Last active August 29, 2015 14:11 — forked from juliangruber/index.js
requirebin sketch
var unique = require('uniq');
var data = [1, 2, 2, 3, 4, 5, 5, 5, 6];
console.log(unique(data));
@asicfr
asicfr / struts.xml
Created October 8, 2012 14:32
struts2RestJpaBootstrap - struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<constant name="struts.devMode" value="false" />
<constant name="struts.ui.theme" value="html5bootstrap" />
<constant name="struts.custom.i18n.resources" value="global" /><!-- fichier properties global a toute l'application : global.properties -->
@asicfr
asicfr / tree
Created October 8, 2012 14:38
struts2RestJpaBootstrap - structure du projet
+---src
+---main
+---java
+---resources
+---webapp
+---css
+---img
+---javascript
+---WEB-INF
@asicfr
asicfr / persistence.xml
Created October 8, 2012 15:08
struts2RestJpaBootstrap - persistence
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="jpaderby" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>org.demo.vo.bean.Book</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.DerbyDialect"/>
<property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.ClientDriver"/>
<property name="hibernate.connection.url" value="jdbc:derby://localhost:1527/bookstore"/>