I hereby claim:
- I am mark-adams on github.
- I am kramsmada (https://keybase.io/kramsmada) on keybase.
- I have a public key whose fingerprint is A18A 7DD3 283C CF2A B0CE FE0E C7A0 5E3F C972 098C
To claim this, I am signing this object:
// API Echo Server | |
// Developed by Mark Adams <[email protected]> | |
var net = require('net'); | |
var server = net.createServer(function(c){ | |
c.on('data', function(buffer){ | |
c.write('HTTP/1.1 200 OK\n\r\n'); | |
c.write(buffer.toString()); |
import itertools | |
import string | |
import math | |
default_alphabet = string.uppercase | |
def product_depth_first(alphabet=default_alphabet): | |
alphabet_list = [alphabet] | |
print 'Storing data using Lists!' | |
# Notice there are three lists | |
names = ['Bob', 'Phil', 'Dave'] | |
addresses = ['123 Happy Ln.', '456 Mtn. Rd.', '1000 Century Dr.'] | |
phones = ['111-111-1111', '222-222-2222', '333-333-3333'] | |
# To access data about a person, you reference the same index in all three lists | |
print '{0} {1} {2}'.format(names[0], addresses[0], phones[0]) | |
I hereby claim:
To claim this, I am signing this object:
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace aes_example | |
{ | |
using System; |
#!/usr/bin/env python2 | |
import textwrap | |
import os | |
ca_dir = '/etc/docker/certs.d/docker.sltc.local' | |
ca_cert = '''-----BEGIN CERTIFICATE----- | |
MIIDjDCCAnSgAwIBAgIQDlz2BfGJBr9MRgvOLbrKrDANBgkqhkiG9w0BAQUFADBO | |
MRUwEwYKCZImiZPyLGQBGRYFbG9jYWwxGTAXBgoJkiaJk/IsZAEZFglTaW1wbGVM | |
VEMxGjAYBgNVBAMTEVNpbXBsZUxUQy1Sb290LUNBMB4XDTEwMTIyODIyMDMyNVoX |
# This guy runs in linear O(n) time. That is good but its somewhat complex | |
def fib(n): | |
if n == 0 or n == 1: # 1 | |
return 1 | |
lastNum = 1 # 1 | |
currentNum = 1 # 1 | |
idx = 1 # 1 | |
/* | |
* Target Sums: Given a distinct list of unordered integers and an integer known as the target | |
* sum, devise a function that outputs true if some combination of two numbers from the list can | |
* add up to the target sum. Otherwise, return false. | |
*/ | |
// This solution is the typical brute force that executes in O(n^2) | |
// n = arr.length | |
function targetSums(arr, target) { |
# This modified version of the gpg-agent.conf script should replace the version in | |
# /usr/share/upstart/sessions/ on Ubuntu 14.10 | |
# | |
# Description: Sets SSH_AUTH_SOCK and SSH_AGENT_PID global environment variables if SSH | |
# support is enabled in the gpg-agent configuration. | |
# | |
# Suggested it as a patch to Ubuntu's gpg2 package via | |
# https://code.launchpad.net/~kramsmada/ubuntu/vivid/gnupg2/1407513-gpg-agent-set-ssh-env-vars/+merge/245538 | |
# |
module Fluent | |
class LiftJsonFilter < Filter | |
Fluent::Plugin.register_filter('lift_json', self) | |
def filter(tag, time, record) | |
begin | |
record = record.merge JSON.parse(record['log']) | |
record.delete 'log' | |
rescue Exception | |
end |