Skip to content

Instantly share code, notes, and snippets.

View glennblock's full-sized avatar

Glenn Block glennblock

View GitHub Profile
/*
Slash Webtasks: Extend Slack with Node.js, powered by Auth0 Webtasks (https://webtask.io)
For documentation, go to https://github.com/auth0/slash
You can find us on Slack at https://webtask.slack.com (join via http://chat.webtask.io)
*/
module.exports = (ctx, cb) => {
// TIPS:
@glennblock
glennblock / node.js
Last active November 25, 2016 06:38 — forked from Manny7311/node.js
Webtask Stripe
'use latest';
import stripe from 'stripe';
module.exports = function(ctx,cb) {
var STRIPE_SECRET_KEY = ctx.secrets.STRIPE_SECRET_KEY;
stripe(STRIPE_SECRET_KEY).charges.create({
amount: ctx.data.amount,
currency: ctx.data.currency,
source: ctx.body.stripeToken,
var request = require('request');
module.exports = function (ctx, req, res) {
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify({text:':hourglass:'}));
var url = ctx.body.text;
var response_url = ctx.body.response_url;
var options = {
url: url,
headers: {
using SlackAPI;
var client = new SlackSocketClient("[SLACK_TOKEN]");
client.Connect((connected) =>{}, () =>{
Console.WriteLine("Connected");
client.PostMessage(
resp => {
Console.WriteLine("Posted");
},
"[CHANNEL]",
[http://test]
disabled = 0
token = 16229CD8-BB6B-449E-BA84-86F9232AC3BC
index =
description = test
http://halo.bungie.net/images/News/WeeklyUpdate/DeathsHeatmapValhallaBlack.jpg
@glennblock
glennblock / Program.cs
Last active November 28, 2015 16:16
CSharp_kvstore
using System;
using System.Threading.Tasks;
using Splunk.Client;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
namespace kvstore
{
class Program
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{911E67C6-3D85-4FCE-B560-20A9C3E3FF48}") = "scriptcs", "C:\Users\Glenn Block\.svm\versions\dev\scriptcs.exe", "{588A83D2-0B85-4380-B1F7-75CE3085D888}"
ProjectSection(DebuggerProjectSystem) = preProject
PortSupplier = 00000000-0000-0000-0000-000000000000
Executable = C:\Users\Glenn Block\.svm\versions\dev\scriptcs.exe
RemoteMachine = localhost
StartingDirectory = C:\src\test
package main
import "fmt"
type person struct {
name string
age int
}
func (p *person) birthday() {
package main
import "fmt"
func iterator(start, end int, action func(int)) {
for i:=start; i<=end; i++ {
action(i)
}
}