View capi.cpp
#include "capi.h"
/* Helper for writebacks */
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) {
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
capi::capi(std::string base_url){
root_url = base_url;
View capi.h
#ifndef CAPI_H
#define CAPI_H
#include <iostream>
#include <string>
#include <stdio.h>
#include <curl/curl.h>
class capi {
View austingwalters.c
/********* Sample code generated by the curl command line tool **********
* All curl_easy_setopt() options are documented at:
* https://curl.haxx.se/libcurl/c/curl_easy_setopt.html
************************************************************************/
#include <curl/curl.h>
int main(int argc, char *argv[]) {
CURLcode ret;
CURL *hnd;
View curl_austingwalters_to_cfile.sh
curl http://austingwalters.com --libcurl austingwalters.c
View keybase_salt.js
// Step One: Salt
$.ajax({
async: true,
type: 'GET',
url: "https://keybase.io/_/api/1.0/getsalt.json",
async: false,
data: {"email_or_username": username},
success: function(salt) {
if(salt && salt.status && salt.status.name == "OK"){
View keybase_login.js
// Step One: Salt
$.ajax({
async: true,
type: 'GET',
url: "https://keybase.io/_/api/1.0/getsalt.json",
async: false,
data: {"email_or_username": username},
success: function(salt) {
if(salt && salt.status && salt.status.name == "OK"){
View CryptoJS.enc.u8array.js
CryptoJS.enc.u8array = {
stringify: function (wordArray) {
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
var u8 = new Uint8Array(sigBytes);
for (var i = 0; i < sigBytes; i++) {
var byte = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
u8[i]=byte;
}
View lcm.py
# Finds the lowest common multiple
def lcm(deck):
p = 1
for i in range(0, len(deck)):
p = p * int(deck[i] / gcd(p, deck[i]))
return p