Skip to content

Instantly share code, notes, and snippets.

View marcsolanadal's full-sized avatar

Marc Solà Nadal marcsolanadal

View GitHub Profile
(use 'clojure.walk)
(def my-vec [[1 2] [3 4]])
(def simple-vec [1 2])
; mapv approach
(defn rand-walk [x a] (+ x (* a (- (rand) (rand)))))
(defn rwalk->vec [v a] (mapv #(rand-walk % a) v))
; working
Shell.exec("ssh-keyscan"
+ " -p " + parsedUrl.port
+ " -t rsa "
+ parsedUrl.hostname, function(code, output) {
var commentedKey = output.split('\n');
var key = commentedKey[1].split(' ');
publicKey = key[1] + ' ' + key[2];
hostString = '[' + parsedUrl.hostname + ']:' + parsedUrl.port
+ ',[' + remoteIP + ']:' + parsedUrl.port
var filePath = res.execution.project.folder
+ settings.fileSystem.artifactsFolder
+ '/'
+ res.filename;
reply.file(filePath, {filename: res.filename});
{
method: 'GET',
path: '/Artifact/{id}/getFile',
config: {
handler: controllers.Artifact.getFile,
tags: ['api'],
description: 'gets the file of a given artifact using its id',
auth: false,
// auth: {
/**
* Creates a new git repo on Stash using their API
*
* @method createStashRepo
* @param {string} repoName Name of the repo to create
* @returns {promise}
*/
createStashRepo: function (repoName) {
var repoOptions = {
"name": repoName,
utils.validateKeystore = function (path, keystore, passwd, alias) {
if (typeof path === 'undefined') {
path = ".";
}
var deferred = Q.defer();
// check file extension
if (keystore.indexOf(".keystore") == -1) {
keystore += ".keystore";
{
"project": {
"name": "Proyecto iOS desde Mocha 34f61bf0-83bd-11e5-815a-c1f94f9b65be"
},
"url": "http://localhost:8080",
"user": "mat",
"token": "360fcde05063014618e36c908ef5eccf",
"auth": "bWF0OjM2MGZjZGUwNTA2MzAxNDYxOGUzNmM5MDhlZjVlY2Nm",
"pipelineDirectory": "/Users/mat/Development/HYBREED/_TEMPLATES/pipelines/_MLM_IOS_",
"gitRepo": "undefined/34f61bf0-83bd-11e5-815a-c1f94f9b65be.git",
grepCommand.on('close', function (code) {
if (code === 0) {
var dateFinish = result.replace(/([^]*)(hasta: )([^\n]*)(\n)([^]*)/gm, "$3");
console.log("DATE: " + dateFinish);
console.log("keystore is valid");
deferred.resolve();
} else {
console.error("Error validating keystore");
deferred.reject("Error validating keystore");
}
" The silver searcher with CtrlP
let g:ctrlp_map = '<C-P>'
nnoremap \ :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>
if executable('ag')
set grepprg=ag\ --nogroup\ --nocolor
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
let g:ctrlp_use_caching = 0
endif
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_custom_ignore = '\v[/\](node_modules|target|dist)|(\.(swp|ico|git|svn))$'
showLicenseConditions: function (firstAcc) {
var self = this;
Hybreed.UI.showSpinner();
if (firstAcc) {
navigator.silkUA.checkUserAgreement(this.language, function (res) {
console.log('<Controller.js> language: ' + res);