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
(ns doggallery.images-test | |
(:require [clojure.test :refer :all] | |
[buddy.core.codecs :as codecs]) | |
(:require [example.images :refer :all])) | |
(deftest imgproxy-url-generation | |
; this test replicates the java upstream | |
; https://github.com/imgproxy/imgproxy/blob/master/examples/signature.java | |
(testing "generate signed url for imgproxy" |
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
(ns church.buttstuff.certs | |
(:require | |
[clojure.java.io :as io] | |
(:import | |
(java.security Keystore) | |
(java.security.cert CertificateFactory) | |
(javax.net.ssl SSLContext) | |
(javax.net.ssl TrustManagerFactory))) | |
(defn use-custom-ssl? |
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
(ns semicircle.core | |
(:require | |
[cljfx.api :as fx] | |
(:import | |
[javafx.application Platform] | |
[javafx.scene.paint Color] | |
[javafx.scene.canvas Canvas]) | |
(:gen-class)) | |
(def *state |
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 python3 | |
import argparse | |
from phue import Bridge | |
def main(bridge_ip): | |
bridge = Bridge(bridge_ip) | |
api = bridge.get_api() | |
lights = api['lights'] | |
for light in lights: |
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
import requests | |
import json | |
url = "https://waterservices.usgs.gov/nwis/iv/?site=14211720&format=json" | |
response = requests.get(url) | |
# there's probably a better way to get here than this blob | |
data = response.json()['value']['timeSeries'][0]['values'][0]['value'] | |
print(data) |
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
import machine | |
import neopixel | |
import time | |
def cycle(np): | |
n = np.n | |
for i in range(4 * n): | |
for j in range(n): | |
np[j] = (0, 0, 0) |
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
import java.io.*; | |
import java.util.*; | |
public class Interview { | |
private static int findMissing(int[] array) { | |
int length = array.length; | |
// This three-line implementation is better but possibly less easy to understand. | |
// We use some math here: sum the numbers from 1 to (length + 1) |
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 | |
# This is to work around https://github.com/mitchellh/vagrant/issues/7747 | |
# | |
# 1) Link the Vagrant-provided openssl executable to the right dylibs | |
# 2) Set OPENSSL_CONF to the actual location of the configuration file | |
# instead of /vagrant-substrate/staging/embedded, which doesn't exist | |
set -e | |
sudo install_name_tool -change "/vagrant-substrate/staging/embedded/lib/libssl.1.0.0.dylib" "/opt/vagrant/embedded/lib/libssl.1.0.0.dylib" /opt/vagrant/embedded/bin/openssl |
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
import time | |
import lxml.etree | |
import requests | |
# import dateutil.parser as dateparser | |
import cachetools | |
from time import strftime | |
from apscheduler.schedulers.background import BackgroundScheduler | |
ATOM_NS = "{http://www.w3.org/2005/Atom}" |
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 ruby | |
require 'mqtt' | |
require 'json' | |
require 'yaml' | |
require 'bigdecimal' | |
require 'logger' | |
require 'SSD1306' | |
require 'rufus-scheduler' |
NewerOlder