Skip to content

Instantly share code, notes, and snippets.

View themarcba's full-sized avatar

Marc Backes themarcba

View GitHub Profile
.transparent {
zoom: 1;
filter: alpha(opacity=70);
opacity: 0.7;
}
if [ "$1" == "develop" ] || [ "$1" == "d" ] || [ -z "$1" ]; then
echo "Pushing to develop..."
git push code develop
elif [ "$1" == "master" ] || [ "$1" == "m" ]; then
echo "Pushing to master..."
git push code master
else
echo "Push feature/$1..."
git push code "feature/$1"
fi
if [ "$1" == "develop" ] || [ "$1" == "d" ] || [ -z "$1" ]; then
echo "Pushing to develop..."
git pull code develop
elif [ "$1" == "master" ] || [ "$1" == "m" ]; then
echo "Pushing to master..."
git pull code master
else
echo "Push feature/$1..."
git pull code "feature/$1"
fi
git add -A .
if [ -z "$0" ]; then
git commit -am "- undefined -"
else
git commit -am "$*"
fi
@themarcba
themarcba / http.sh
Last active September 8, 2015 23:10
ifconfig en0 | grep inet
if [ -z "$1" ]; then
python -m SimpleHTTPServer 8080
else
python -m SimpleHTTPServer $1
fi
// Transforms a string to either upper or lowercase, depending which is dominant
// code => code
// coDe => code
// CoDE => CODE
// etc.
const transform = input => {
const lower = [...input].reduce((count, char) => {
return char == char.toLowerCase() ? count + 1 : count
}, 0)
return lower / input.length >= .5 ? input.toLowerCase() : input.toUpperCase()
window.App.startLocalMedia(video, screencapture, audioonly, receiveonly, null, null).then(
function(o) {
if (!receiveonly) {
fm.liveswitch.Log.info('Started local media.')
}
fm.liveswitch.Log.info('Registering...')
window.App.joinAsync(_this.incomingMessage, _this.peerLeft, _this.peerJoined, _this.clientRegistered).then(
function(o) {
const timedResolve = name => {
return new Promise(resolve =>
setTimeout(() => {
console.log(name)
resolve()
}, 500 * Math.random()),
)
}
Promise.all([
your_collection.find({
your_date_field: {
$gte: ISODate('2020-07-01T00:00:00.000Z'), // From
$lt: ISODate('2020-07-31T23:59:00.000Z'), // Until
},
})
const { computed, ref, effect } = require('@vue/reactivity')
let users = ref([])
let onlineUsers = computed(() => {
return users.value.filter((user) => user.status === 'online')
})
effect(() => {
console.log('# of online users changed', onlineUsers.value.length)
})