Skip to content

Instantly share code, notes, and snippets.

Matthew Molloy whamtet

Block or report user

Report or block whamtet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View repl.cs
using clojure.lang;
IFn load = clojure.clr.api.Clojure.var("clojure.core", "load-string");
load.invoke("(clojure.core.server/start-server {:port 5555 :name \"repl\" :accept 'clojure.core.server/repl})" +
"(println \"serving!\")");
View open.cljs
#!/usr/local/bin/planck
(require '[planck.core :refer [*in* slurp]])
(require '[planck.shell :refer [sh]])
(defn round-nth [s i]
(nth s (mod i (count s))))
(let [to-open
(as-> *in* $
(slurp $)
View videoProfilePic
import { FaCamera, FaImage, FaArrowLeft } from 'react-icons/lib/fa';
import * as $ from 'jquery';
export const modal = (id: string, title: string, body: object, footer?: object) => (
<div className="modal fade" id={id} role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div className="modal-dialog" role="document">
<div className="modal-content">
<div className="modal-header">
<h5 className="modal-title" id="exampleModalLabel">{title}</h5>
<button type="button" className="close" data-dismiss="modal" aria-label="Close">
View spit-google-sheets.clj
(ns analyze.spit-sheets)
(import com.google.api.services.sheets.v4.SheetsScopes)
(require 'google-apps-clj.credentials)
(require '[google-apps-clj.google-sheets-v4 :as gs4])
(def scopes [SheetsScopes/DRIVE SheetsScopes/SPREADSHEETS])
(def creds (google-apps-clj.credentials/default-credential scopes))
;(println (gd/list-files! creds "0BxDSmBQ-JH6xLTZ5R3psbkUzNEE"))
(def service (gs4/build-service creds))
View grails-adapter.clj
;compile "ring:ring-core:1.5.0"
;compile "ring:ring-servlet:1.5.0"
;compile "ring:ring-defaults:0.2.1"
;compile "org.clojure:tools.nrepl:0.2.12"
;compile "org.clojure:clojure:1.8.0"
(require '[ring.util.servlet :as servlet])
(defn merge-servlet-keys [request-map servlet-context request response]
(merge request-map
View html_render.clj
(ns render.format)
(defn standardize [form]
(cond
(vector? form)
(let [[k m & rest] form]
(if (map? m)
(vec (list* k m (map standardize rest)))
(vec (list* k {} (standardize m) (map standardize rest)))))
(seq? form)
View localization.groovy
private static load_string = clojure.java.api.Clojure.var('clojure.core', 'load-string')
private static localization = load_string.invoke('''
(require '[clojure.java.io :as io])
(defn cljs-resource [path] ;does this work in production?
(io/resource (str "META-INF/assets/taipan_reagent/src/" path)))
(defn needed-messages [path]
(distinct (map second (re-seq #"\\(messages \\"(\\w+?)\\"\\)" (slurp (cljs-resource path))))))
View defm.clj
(defmacro defm [symbol arglist m & rest]
`(def ~symbol (with-meta (fn ~arglist ~@rest) ~m)))
View compile-outlook-cs.clj
(def assembly-path "C:\\Users\\cplmam\\Downloads\\microsoft.office.interop.outlook.15.0.4797.1003\\lib\\net20\\Microsoft.Office.Interop.Outlook.dll")
(assembly-load-from assembly-path)
(import Microsoft.CSharp.CSharpCodeProvider)
(import System.CodeDom.Compiler.CompilerParameters)
(def provider (CSharpCodeProvider.))
(def assemblies (into-array [assembly-path]))
(def compilerparams (CompilerParameters. assemblies))
(.set_GenerateExecutable compilerparams false)
View BetterDataFrame.scala
import org.apache.spark.sql.{SQLContext, DataFrame}
import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
import org.apache.spark.sql.execution.{ExplainCommand, QueryExecution}
import org.apache.spark.sql.catalyst.InternalRow
//Sorry about the clojure, we need it to sidestep the Scala typesystem
import clojure.java.api.Clojure
import clojure.lang.IFn
class BetterDataFrame(override val sqlContext: SQLContext, override val logicalPlan: LogicalPlan) extends DataFrame(sqlContext, logicalPlan) {
You can’t perform that action at this time.