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
/** | |
* Usage: | |
* var foo = new SpreadShitter({ | |
* sheetId: <this id is in the spreadsheet url>, | |
* googleApiKey: <any google api key>}); | |
* var sheetName = "My sheet"; | |
* var range ="!A1:A2"; | |
* foo.getValue(sheetName, range, function(data, errorEvent) { | |
* // handle logix here... | |
* }) |
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/sh | |
splitHorizontal() { tmux split-window -d -t 0 -h ; } | |
splitVertical() { tmux split-window -d -t $1 -v ; } | |
replicateM() { for i in `seq 1 $1`; do splitHorizontal; done } | |
splitEven() { for i in `seq 0 $1`; do splitVertical $(($i * 2)); done } |
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 | |
# autogenerate compose file avoiding file name colisions in the current directory | |
COMPOSE_FILE_NAME=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 10).xml | |
cat << EOF > ${COMPOSE_FILE_NAME} | |
version: "3.4" | |
services: | |
alpine: | |
image: alpine |
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
redis-cli --raw -d "," hgetall mykey | awk -F',' 'BEGIN { print "{" } | |
{ for (i=1; i < NF; i++) { | |
if (i%2) { | |
printf "\"%s\"", $i | |
} else { | |
printf ":%s,\n", $i | |
} | |
} | |
} | |
END { printf ":%s\n}", $NF}' |
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 | |
# Author: Sebastian Treu | |
# Date: 2018.06.01 | |
# | |
# You will need root access for using this script. The best thing you can do | |
# is to add this script to the sudoers file (or just don't use it :) | |
# | |
usage() { | |
echo "Usage:" |
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 request = require('request'); | |
var slack_token = process.env.SLACK_TOKEN; | |
var channel = process.env.SLACK_CHANNEL; | |
request.post({ | |
url: 'https://slack.com/api/auth.test', | |
formData: { | |
token: slack_token | |
} |
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 | |
# | |
# Copyright note: | |
# --------------- | |
# | |
# This script is a modification from: | |
# https://support.zabbix.com/secure/attachment/49385/get.sh | |
# written by gleb@irc#zabbix | |
# |
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
<template name="dialog"> | |
<div class="modal fade" id="{{dialogId}}"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | |
<span aria-hidden="true">×</span> | |
</button> | |
<h4 class="modal-title">{{dialogTitle}}</h4> | |
</div> |
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
selector: function( userId ) { | |
var roleNames = _.pluck(Roles.find({users: {$in: [userId]}}, {fields: {name: 1, _id: 0}}).fetch(), 'name'); | |
var users = []; | |
var query; | |
if (_.contains(roleNames, 'manager')) { | |
// this wrapping is just for keeping the code readable | |
query = Meteor.users.find({}, { fields: {_id: 1 }, transform: function (doc) { doc.users = doc._id; return doc;}}); | |
// or: | |
// query = { users: [ userId ] }; | |
} else if (_.contains(roleNames, 'admin')) { |
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
{{#autoForm ... }} | |
... | |
{{> afQuickField name="createdBy" }} | |
... | |
{{/autoForm}} |
NewerOlder