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
version: '3.8' | |
services: | |
mongo1: | |
image: mongo:latest | |
container_name: mongo1 | |
networks: | |
- mongo-net | |
ports: | |
- "27017:27017" |
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
#!/bin/bash | |
COMMIT_FILE=$1 | |
COMMIT_MSG=$(cat $1) | |
JIRA_URL="≤JIRA_BASE_URL>/browse/" | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop) | |
fi |
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
#!/usr/bin/env bash | |
GITHUB_USERNAME= | |
GITHUB_AUTH_TOKEN= | |
GITHUB_SEARCH_QUERY="is:open%20is:pr%20review-requested:Stoffo%20archived:false" | |
change_anybar_color () { | |
echo -n $1 | nc -4u -w0 localhost 1738 | |
} |
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 palindrome(str) { | |
// Convert to lower case and replace everything what's not a letter or a number. | |
var x = str.toLowerCase().replace(/[^a-z0-9]/g, ''); | |
//convert string to array, turn it around and put it back together an match it against filtered string: | |
return x.split('').reverse().join('') === x; | |
} | |
palindrome("eye"); |
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
const PI = 3.1415926535; | |
function foo(a = 123, b = '') { | |
return PI | |
} | |
function bar(a, b, c, ...x) { | |
return x.length; |
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
var defaultTitle = document.title; | |
// subscribe to visibility change events | |
document.addEventListener('visibilitychange', function () { | |
// fires when user switches tabs, apps, goes to homescreen, etc. | |
if (document.visibilityState === 'hidden') { | |
document.title = 'Baby, Come Back!' | |
} | |
// fires when app transitions from prerender, user returns to the app / tab. | |
if (document.visibilityState === 'visible') { |
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
<style> | |
ul { | |
counter-reset: foo; | |
} | |
li:before { | |
counter-increment: foo; | |
content: 'Count: ' counter(foo); | |
} | |
</style> |
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
$(window).on('keyup', function (e) { | |
switch (e.keyCode) { | |
/*left*/ | |
case 37: | |
console.log('left'); | |
break; | |
/*right*/ | |
case 39: | |
console.log('right'); | |
break; |
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
var date = new Date(); | |
var daysToDeletion = 120; | |
var deletionDate = new Date(date.setDate(date.getDate() - daysToDeletion)); | |
printjson(deletionDate); | |
var db = db.getSiblingDB('db') | |
db.getMongo().setSlaveOk(); | |
printjson(db.messages.find({insertDate : {$lt : deletionDate}}).count()); |
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
<?php | |
$function_filedate = new Twig_SimpleFunction( | |
'fileDate', | |
/** | |
* @param $file_path | |
* This function generates a new file path with the last date of filechange | |
* to support better better client caching via Expires header: | |
* i.e: |
NewerOlder