Skip to content

Instantly share code, notes, and snippets.

View acemtp's full-sized avatar
🏠
Working from home

Vianney Lecroart acemtp

🏠
Working from home
View GitHub Profile
@acemtp
acemtp / gist:12e7f0ac0e3d898dce0840aa3e2852d0
Last active September 30, 2019 16:35
Collaborative Lego Block
# Collaborative Lego Block
## Goal
- Have a scene with a plan
- Click on the plan adds a box on the click position
- Click on a box adds a box relative to the box
- Right click deletes the box under the mouse
## Requirement
> db.SpiderableCacheCollection.find()
{ "_id" : "Xab8PM2xDSM56k2vL", "hash" : "5707414e1347e834e6820bf149a566c9a88e30e1edbab481a235777fe056d7aa", "url" : "https://ploki.io/blog/meteor/hackathon-meteor-a-paris-le-10-et-11-octobre-2015-3gqnZB8MfQY7jbd3L", "headers" : [ { "name" : "Server", "value" : "nginx/1.4.6 (Ubuntu)" }, { "name" : "Date", "value" : "Wed, 28 Oct 2015 21:29:46 GMT" }, { "name" : "Content-Type", "value" : "text/html; charset=utf-8" }, { "name" : "Transfer-Encoding", "value" : "chunked" }, { "name" : "Connection", "value" : "keep-alive" }, { "name" : "Vary", "value" : "Accept-Encoding" }, { "name" : "Expires", "value" : "Fri, 27 Nov 2015 21:29:46 GMT" }, { "name" : "Cache-Control", "value" : "max-age=2592000" }, { "name" : "Strict-Transport-Security", "value" : "max-age=31536000;" }, { "name" : "Content-Encoding", "value" : "gzip" } ], "content" : "<!DOCTYPE html><html><head>\n <link rel=\"stylesheet\" type=\"text/css\" class=\"__meteor-css__\" href=\"/f531d36b660979278e4b4256bc816cebf215c073
ceci est un gist! nouveau
<template name="dialogAppNew">
<div id="dialogAppNew" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Create a new App</h4>
</div>
<div class="modal-body">
<p>Just enter the name of your application.</p>
@acemtp
acemtp / server.js
Last active December 14, 2015 05:49
update all the db id to the new format
Meteor.methods({
fixMongoIds: function () {
fixMongoIds( [Meteor.users, ****put here all other collections you have****] );
// fixMongoIds( [Meteor.users, Documents, Dogs, Foobars] ); // example
return true;
}
});
function fixCollectionIds( CollectionToFix, Collections, ElementsCurrentCount, ElementsTotalCount) {
if (Meteor.isClient) {
Meteor.startup(function () {
Meteor.setInterval(function () {
var before = new Date().getTime();
Meteor.call('keepAlive', function (error, result) {
var after = new Date().getTime();
if(error) console.log(error);
console.log("ping in ", after - before);
});
}, 1000);
/*global Meteor:true, Session:true, Template:true, Blocks:true, Dokio:true, HistoryBlocks:true */
Blocks = new Meteor.Collection("blocks");
function saveBlock() {
var block = Blocks.findOne({});
var o = block.text;
var n = $('.editor').html();
if(o != n) {
Blocks.update(block._id, { $set: { text: n } });
Oct 3 07:32:42 shard kernel: frontend_servic invoked oom-killer: gfp_mask=0xd0, order=0, oom_adj=0, oom_score_adj=0
Oct 3 07:32:42 shard kernel: frontend_servic cpuset=/ mems_allowed=0
Oct 3 07:32:42 shard kernel: Pid: 8692, comm: frontend_servic Not tainted 3.2.13-grsec-xxxx-grs-ipv6-32 #1
Oct 3 07:32:42 shard kernel: Call Trace:
Oct 3 07:32:42 shard kernel: [<c10d105e>] dump_header+0x7e/0x1b0
Oct 3 07:32:42 shard kernel: [<c10d1600>] oom_kill_process+0x60/0x280
Oct 3 07:32:42 shard kernel: [<c10d1553>] ? select_bad_process+0xd3/0x120
Oct 3 07:32:42 shard kernel: [<c10d18f3>] out_of_memory+0xd3/0x1e0
Oct 3 07:32:42 shard kernel: [<c10d58f5>] __alloc_pages_nodemask+0x5e5/0x600
Oct 3 07:32:42 shard kernel: [<c193beee>] tcp_sendmsg+0x69e/0xf00
function grant($count = 1) {
global $DBc,$log;
echo $count."\n";
}
create_table :posts do |t|
t.string :name
t.integer :category_id
end
create_table :categories do |t|
t.string :name
end