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
# Repo to deploy | |
export GIT_CLONE_REPO=$1 | |
# Fix debian | |
apt update | |
apt-get install --reinstall build-essential | |
# Install git | |
apt install -y git |
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
apt-get update | |
apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg2 \ | |
software-properties-common -y | |
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - | |
add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/debian \ |
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
function SongKickHotel(){ | |
this.events = []; | |
} | |
SongKickHotel.prototype = { | |
buildHotelButton: function(href){ | |
return $(`<a href="${href}" target="_blank"> | |
<span class="button buy-tickets" style=" | |
background: url('https://www.trivago.es/favicon.ico') no-repeat; | |
background-color: #27335f; | |
padding-left: 14px; |
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
/** | |
* REFERENCES | |
* - https://www.cssscript.com/demo/pure-css-circular-percentage-bar/ | |
* - http://game-icons.net | |
* - https://developers.trello.com/reference/ | |
*/ | |
Array.prototype.do = function(cb){ | |
return this.map(function(){ |
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
function parseData(js, user){ | |
var timeTaken = c => parseFloat((c.timeTaken ||(new Date().getTime()-Date.parse(c.data[0].date))) / 1000 / 60 / 60).toFixed(2); | |
var endDate = c => c.data[c.data.length-1].type == "addMemberToCard" ? "Working...": c.data[c.data.length-1].date; | |
return [[]].concat(js.filter(j => !j.member || j.member.id == user.id).sort((a,b) => Date.parse(a.date) - Date.parse(b.date))) | |
.reduce((a,b) => { | |
var k = b.data.card.name, card = a.find(c => c.name === k) || a[a.push(Object.assign({data:[]}, b.data.card))-1]; | |
card.data.push(b); | |
if(b.type == "addMemberToCard") | |
card.lastJoin = b.date; | |
if(b.type == "removeMemberFromCard"){ |
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
function cartesian(arr) { | |
return arr.reduce((a, b) => | |
a.map(x => b.map(y => x.concat(y))) | |
.reduce((a, b) => a.concat(b), []), [[]]); | |
} | |
function parse(f){ | |
var re = /\[([0-9a-zA-Z,]+[^\]]+)\]/gm; | |
var m = null; | |
var res = []; | |
var lastIndex = 0; |
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
@echo off | |
if "%1" == "" goto error | |
SET card=%1 | |
For %%A in ("%card%") do ( | |
Set Branch=%%~nxA | |
) | |
echo.Branch is: %Branch% | |
hg pull |
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
(SembAI = { | |
loadAI: function() { | |
var d = jQuery.Deferred(); | |
var oThis = this; | |
jQuery.getScript("https://sdk.clarifai.com/js/clarifai-latest.js", () => { | |
oThis.app = new Clarifai.App( | |
'xZqcIvLNv0f9wNzuVtA97ntA2CB8IHSVFzKc0hzv', | |
'KYkdTnFHmT6D4Yv8gk5gEPc__1fZ2nJItBrrI8hM'); | |
console.log("Clarifai loaded"); | |
d.resolve(window.SembAI); |
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
function tagit(){ | |
var app = new Clarifai.App( | |
'xZqcIvLNv0f9wNzuVtA97ntA2CB8IHSVFzKc0hzv', | |
'KYkdTnFHmT6D4Yv8gk5gEPc__1fZ2nJItBrrI8hM' | |
); | |
function tags(url, callback){ | |
// predict the contents of an image by passing in a url | |
app.models.predict(Clarifai.TRAVEL_MODEL, url) | |
.then( | |
function(response) { |
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
// Start `node d3-server.js` | |
// Then visit http://localhost:1337/ | |
// | |
var d3 = require('d3'), | |
http = require('http') | |
http.createServer(function (req, res) { | |
// Chrome automatically sends a requests for favicons | |
// Looks like https://code.google.com/p/chromium/issues/detail?id=39402 isn't | |
// fixed or this is a regression. |
NewerOlder