Repository: https://github.com/maio/graphql-basics-workshop
const graphql = require('graphql');
const storage = require('../storage/storage.js');
const {
GraphQLSchema,
Repository: https://github.com/maio/graphql-basics-workshop
const graphql = require('graphql');
const storage = require('../storage/storage.js');
const {
GraphQLSchema,
#!/bin/bash | |
# Real CPU Usage Chart | |
# BitBar plugin | |
# | |
# by Marian Schubert | |
# Based on work by Mat Ryer and Tyler Bunnell | |
# | |
# This script requires https://github.com/holman/spark | |
# |
(ns fetaoin.core | |
(:require [irclj.core :as irc] | |
[clojure.data.json :as json])) | |
;; HTTP stuff | |
(defn fetch-json [url] | |
(json/read-str (slurp url))) | |
;; YouTube API | |
(def api-key "sekret") |
(defn deaccent [str] | |
"Remove accent from string" | |
;; http://www.matt-reid.co.uk/blog_post.php?id=69 | |
(let [normalized (java.text.Normalizer/normalize str java.text.Normalizer$Form/NFD)] | |
(clojure.string/replace normalized #"\p{InCombiningDiacriticalMarks}+" ""))) |
(ns kata.core-test | |
(:require [clojure.test :refer :all])) | |
;; Langton's Ant - http://en.wikipedia.org/wiki/Langton's_ant | |
;; | |
;; At a white square, turn 90° right, flip the color of the square, move forward one unit | |
;; At a black square, turn 90° left, flip the color of the square, move forward one unit | |
(def flip | |
{:black :white |
maio:~ $ cat ~/Library/KeyBindings/DefaultKeyBinding.dict | |
{ | |
"~d" = "deleteWordForward:"; | |
"^w" = "deleteWordBackward:"; | |
"~f" = "moveWordForward:"; | |
"~b" = "moveWordBackward:"; | |
"^/" = "undo:"; | |
"^g" = { | |
"^g" = ("insertText:", "[email protected]"); | |
"^d" = ("insertText:", "[email protected]"); |
describe('Ant', function () { | |
it('turns right on white cell', function() { | |
expect(resolveAntDirection('north', 'white')).toEqual(turnRight('north')); | |
expect(resolveAntDirection('south', 'white')).toEqual(turnRight('south')); | |
expect(resolveAntDirection('west', 'white')).toEqual(turnRight('west')); | |
}); | |
it('turns left on black cell', function() { | |
expect(resolveAntDirection('north', 'black')).toEqual(turnLeft('north')); | |
expect(resolveAntDirection('south', 'black')).toEqual(turnLeft('south')); |
(ns kata.core-test | |
(:use clojure.test) | |
(:require [clojure.string :as str])) | |
(def default-delimiter ",|\n") | |
(defn parse-delimiter [s] | |
(if-let [[_ delimiter x] (first (re-seq #"//(.)\n(.*)" s))] | |
[(re-pattern delimiter) x] | |
[(re-pattern default-delimiter) s])) |
[alias] | |
fight = !bash -c 'echo "$0: `git grep $0 | wc -l`" && echo "$1: `git grep $1 | wc -l`"' | |
# Usage: | |
# | |
# $ git fight cancelled canceled | |
# cancelled: 664 | |
# canceled: 19 |