This file contains hidden or 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
| package main | |
| import ( | |
| "bufio" | |
| "bytes" | |
| _ "github.com/Go-SQL-Driver/MySQL" | |
| "database/sql" | |
| "flag" | |
| "fmt" | |
| "io" |
This file contains hidden or 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 crypto = require('crypto'); | |
| var dns = require('native-dns'); | |
| var rest = require('restler'); | |
| var server = dns.createServer(); | |
| server.on('request', function (request, response) { | |
| var domain = request.question[0].name; | |
| if(domain == 'webutils.flourishworks.com') { | |
| // Don't log this because it can't be uniquely identified and subsequently retrieved |
This file contains hidden or 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
| #include <czmq.h> | |
| #define NUM_MESSAGES (50000000) | |
| void no_op(void *unused1, void *unused2) {} | |
| void run_send() { | |
| zctx_t *ctx = zctx_new(); | |
| void *outsock = zsocket_new(ctx, ZMQ_PUSH); | |
| zsocket_connect(outsock, "tcp://localhost:5005"); |
This file contains hidden or 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 | |
| # | |
| # Carbon (part of Graphite) | |
| # | |
| # chkconfig: 3 50 50 | |
| # description: Carbon init.d | |
| . /etc/rc.d/init.d/functions | |
| prog=carbon | |
| RETVAL=0 |
This file contains hidden or 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
Show hidden characters
| { | |
| "cmd": ["/usr/local/go/bin/go","build","$file"], | |
| "selector" : "source.go", | |
| "variants": [ | |
| { "cmd": ["/usr/local/go/bin/go", "run", "$file"], | |
| "name": "Run" | |
| } | |
| ] | |
| } |
This file contains hidden or 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
| public static String decrypt(byte[] cipherText, String encryptionKey) throws Exception{ | |
| Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding", "SunJCE"); | |
| SecretKeySpec key = new SecretKeySpec(encryptionKey.getBytes("UTF-8"), "AES"); | |
| cipher.init(Cipher.DECRYPT_MODE, key,new IvParameterSpec(IV.getBytes("UTF-8"))); | |
| return new String(cipher.doFinal(cipherText),"UTF-8"); | |
| } |
This file contains hidden or 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
| # coding: utf-8 | |
| require 'sinatra' | |
| set server: 'thin', connections: [] | |
| get '/' do | |
| halt erb(:login) unless params[:user] | |
| erb :chat, locals: { user: params[:user].gsub(/\W/, '') } | |
| end | |
| get '/stream', provides: 'text/event-stream' do |
This file contains hidden or 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
| package main | |
| import ( | |
| "bytes" | |
| "encoding/hex" | |
| "flag" | |
| "fmt" | |
| "io" | |
| "log" | |
| "net" |
This file contains hidden or 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 python | |
| import redis | |
| import random | |
| import pylibmc | |
| import sys | |
| r = redis.Redis(host = 'localhost', port = 6389) | |
| mc = pylibmc.Client(['localhost:11222']) |
This file contains hidden or 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
| /** | |
| * Connect and fetch Salesforce data via OAuth | |
| */ | |
| function queryDataFromSalesforce() { | |
| // Read OAuth consumer key / secret of this client app from script properties, | |
| // which can be issued from Salesforce's remote access setting in advance. | |
| var sfConsumerKey = ScriptProperties.getProperty("sfConsumerKey"); | |
| var sfConsumerSecret = ScriptProperties.getProperty("sfConsumerSecret"); | |
| if (!sfConsumerKey || !sfConsumerSecret) { | |
| Browser.msgBox("Register Salesforce OAuth Consumer Key and Secret in Script Properties"); |
NewerOlder