Skip to content

Instantly share code, notes, and snippets.

View ryoakg's full-sized avatar

℟γồ ᾅḳᐃϼ╿ ryoakg

View GitHub Profile
(require '[clojure.java.io :as io])
(import (java.util.prefs Preferences))
(defn- check []
(-> (Preferences/userRoot)
.keys seq)
(-> (Preferences/userRoot)
(.get "foo" "NONE!"))
(-> (io/file (System/getProperty "user.home") ".java" ".userPrefs")
.list seq))
(defn combinations [xs]
(loop [xs xs
as []]
(if-let [[x & xs] xs]
(recur xs (concat as (map #(vector x %) xs)))
as)))
(combinations (range 3))
;; => ([0 1] [0 2] [1 2])
(combinations (range 4))
(import (java.nio.file Files)
(java.nio.file.attribute FileAttribute PosixFilePermissions))
(Files/createTempDirectory (.toPath (io/file "."))
"temp-"
(into-array FileAttribute []))
(Files/createTempDirectory (.toPath (io/file "."))
"temp-"
(into-array FileAttribute [(-> "rwx------"
(boot.core/set-env! :dependencies '[[org.seleniumhq.selenium/selenium-java "3.141.59"]])
(import (org.openqa.selenium WebDriver WebElement)
(org.openqa.selenium.remote RemoteWebElement)
(org.openqa.selenium.chrome ChromeDriver))
(def d (atom nil))
(reset! d (ChromeDriver.))
(.get @d "http://example.com/")
(defun apply-autoimport-to-gore (args)
(unless (null args)
(let ((a (car args)))
(add-to-list 'a "-autoimport")
(setcar args a)))
args)
(advice-add 'gorepl--run-gore :filter-args 'apply-autoimport-to-gore)
;; (advice-remove 'gorepl--run-gore 'apply-autoimport-to-gore)
;;; HITACHIの冷蔵庫のスペックを一括取得
;;; 容量、発売年、消費電力の比較の為
;;; PDF からしか情報が取れないものは無視して、HTML から取れるものだけが対象
(boot.core/set-env! :dependencies '[[org.seleniumhq.selenium/selenium-java "3.9.1"]])
(require '[clojure.string :as str]
'[clojure.set :refer [rename-keys]])
(import (org.openqa.selenium By WebDriver WebElement)
(org.openqa.selenium.chrome ChromeDriver ChromeOptions))
(boot.core/set-env! :dependencies '[;; https://mvnrepository.com/artifact/org/jaudiotagger
[org/jaudiotagger "2.0.3"]])
;; OR
#_(boot.core/merge-env! :repositories
[["Mulesoft " {:url "https://repository.mulesoft.org/nexus/content/repositories/public/"}]]
:dependencies
'[
;; https://mvnrepository.com/artifact/com.github.goxr3plus/jaudiotagger
[com.github.goxr3plus/jaudiotagger "V2.2.6"]])
@ryoakg
ryoakg / .htaccess
Created July 30, 2019 03:36
特定拡張子のみ許可
Order Allow,Deny
<Files ~ "\.(html|js|css|ico|gif|jpg|png)$">
Allow from all
</Files>
// javascript:var c=(
(d,s)=>{var a,b,u,r;a=d.createElement('div');u=a.style;u.position='fixed';u.top='200%';b=d.createElement('pre');b.style.userSelect='auto';a.appendChild(b).textContent=s;d.body.appendChild(a);d.getSelection().selectAllChildren(a);r=d.execCommand('copy');d.body.removeChild(a);return r;}
// );c(document,'1234');
((G,D,B)=>{
var T,U,s,i,c,b,m;
c=(t)=>D.createElement(t);
b=c('div');
s=b.style;
s.width='100%';
s.height='100%';
s.background='#0008';
s.position='fixed';
s.top=0;