This file contains hidden or 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 com.intellij.codeInspection.{LocalInspectionTool, LocalInspectionToolSession, ProblemHighlightType, ProblemsHolder} | |
import com.intellij.psiPsiElementVisitor | |
import org.jetbrains.annotations.NotNull | |
import org.jetbrains.plugins.scala.lang.psi.api.ScalaElementVisitor | |
import org.jetbrains.plugins.scala.lang.psi.api.expr.ScMethodCall | |
class ExampleMatcher extends LocalInspectionTool { | |
@NotNull override def buildVisitor(@NotNull holder: ProblemsHolder, isOnTheFly: Boolean, session: LocalInspectionToolSession): PsiElementVisitor = { | |
buildVisitor(holder, isOnTheFly) | |
} |
This file contains hidden or 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 foo.card-q) | |
(def deck | |
"Given a set of cards, return a deck of those cards" | |
vector) | |
(def card | |
"Given a map of card properties, return a card with those properties" | |
identity) |
This file contains hidden or 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
// Psuedocode | |
void OnSliderChange() { | |
int slider2val = Slider2.val(); | |
int slider3val = Slider3.val(); | |
float slider2proportion = slider2val / (slider2val + slider3val); | |
int totalRemaining = 180 - Slider1.val(); | |
Slider2.setValue((int) totalRemaining * slider2proportion); | |
Slider3.setValue(totalRemaining - Slider2.val()); | |
} |
This file contains hidden or 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 clojure-anagram.core | |
(:use [clojure [string :only [split-lines join]]])) | |
(def words (-> "/Users/you-will-never-guess/misc-src/anagram-jam/4000words.txt" | |
slurp | |
split-lines)) | |
(defn single-word-anagrams-for [word] | |
(let [normalized-word (sort word)] | |
(filter #(= (sort %) normalized-word) words))) |
This file contains hidden or 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
#!/bin/bash | |
#Fill these out, make sure there is no space immediately after the = signs | |
MOBILEDB_PATH=.... | |
SECURITY_SERVICES_PATH=.... | |
PSQL_USER=.... | |
#Upgrade Security Services | |
cd $SECURITY_SERVICES_PATH | |
git pull --ff-only |
This file contains hidden or 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
class Foo | |
def method_missing(*args) | |
puts("Called with: #{args.inspect}") | |
4 | |
end | |
end | |
class Bar < Foo | |
def respond_to?(*args) | |
super |
This file contains hidden or 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
(defn foo [a] a) | |
(defn foo | |
([a] a) | |
([a b] a)) | |
'(defn (foo a) a) | |
'(defn ((foo a) a) | |
((foo a b) a)) |
This file contains hidden or 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 something.something | |
[:import [javax.xml.validation SchemaFactory Validator] | |
[javax.xml.transform.stream StreamSource]]) | |
(defn something [] | |
(let [factory (SchemaFactory/newInstance "http://www.w3.org/2001/XMLSchema") | |
file (clojure.java.io/file "simple.xsd") | |
stream-source (StreamSource. "simple-err.xml"] | |
(-> (.newSchema factory file) | |
(.newValidator) |
This file contains hidden or 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 something.something | |
[:import [javax.xml.validation SchemaFactory Validator] | |
[javax.xml.transform.stream StreamSource]]) | |
(defn something [] | |
(let [factory (SchemaFactory/newInstance "http://www.w3.org/2001/XMLSchema") | |
file (clojure.java.io/file "simple.xsd") | |
schema (.newSchema factory file) | |
validator (.newValidator schema ) | |
stream-source (StreamSource. "simple-err.xml")] |
This file contains hidden or 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
def render_message(template, phone) | |
url_split_thang = UrlShrotenerClient.tokenize(template) | |
url_split_thang.map do |obj| | |
if obj.url? | |
template = Liquid::Template.parse(obj.template) | |
edit(template).render(message_variable_values(phone), filters: [LiquidFilters]) | |
else | |
Liquid::Template.parse(obj.template).render... | |
end |
NewerOlder