Skip to content

Instantly share code, notes, and snippets.

helloworld
dsffd
sdsds
var express = require('express'),
reqpromise = require('request-promise');
function register(req, res, next) {
var user = {};
user.username = req.body.username;
user.password = req.body.password;
user.firstName = req.body.firstName;
user.lastName = req.body.lastName;
user.email = req.body.username;
def defineRoute(routeBuilder) {
routeBuilder.categories {
schema {
properties {
name {
type string,
description "a name"
}
links {
brand "brands"
@kristofsajdak
kristofsajdak / memdiag.js
Created August 11, 2015 16:37
diagnose memory issues logging memwatch diffs and uploading heapdumps to a Box.com folder
var heapdump = require('heapdump');
var memwatch = require('memwatch');
var fs = require('fs');
var os = require("os");
var hostname = os.hostname();
var rest = require('restler');
var timeoutVal = process.env.DUMP_TIMEOUT_VAL;
@kristofsajdak
kristofsajdak / complex1.js
Last active November 18, 2015 10:07 — forked from ssebro/generic-event-consumer.js
Generic template for event consumer
//keys are generated from the collection names.
var orderedAlarmsChangeConsumer = queue({exchange, "name":"ordered.alarms", exclusive:false}).consume(
'canAlarms.insert': function(data) {
if(data.canAlarms[0].archiveRequested){
return createAndSendCanAlarms(data)
},
'canAlarms.delete': function ... ,
'canAlarams.update': function ... ,
@kristofsajdak
kristofsajdak / resetXcodeCarthage.sh
Last active February 22, 2018 15:14 — forked from maciekish/resetXcode.sh
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
open /Applications/Xcode.app