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
""" | |
A really stupid python template language inspired by coffeekup, markaby. | |
Do not use this code, it will ruin your day. A byproduct of insomnia. | |
TL;DR | |
----- | |
This module defines a template language that allows us to do: | |
d = Doc() |
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
/*jshint maxlen: 79 */ | |
var MYSITE = MYSITE || {}; | |
/** | |
* Make YouTube links with .yt-embed replace themselves with YouTube iframes | |
* when clicked. The first child element is assumed to be the img element | |
* holding the poster frame. The YouTube URL must contain the "v" parameter, | |
* but no further parameters. The data-yt-options attribute may hold iframe | |
* URL parameters. |
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
<?xml version="1.0" encoding="utf-8"?> | |
<Project DefaultTargets="PrepareStaticContent" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<!-- Passed in Parameters --> | |
<configuration></configuration> | |
<workingDir></workingDir> | |
<buildNumber></buildNumber> | |
<buildViews>false</buildViews> | |
<minifyJs>true</minifyJs> | |
<TargetsDirectory></TargetsDirectory> |
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 base64 | |
import hmac | |
import hashlib | |
from urllib import parse | |
from django.contrib.auth.decorators import login_required | |
from django.http import HttpResponseBadRequest, HttpResponseRedirect | |
from django.conf import settings | |
@login_required |
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 repl.reactions | |
(:require [clojurians-log.application :as app] | |
[clojurians-log.slack-api :as slack] | |
[clojurians-log.db.queries :as q] | |
[clojurians-log.db.import :as import] | |
[clojurians-log.data :as data] | |
[clojure.java.io :as io] | |
[clojurians-log.datomic :as d] | |
[clojure.tools.reader.edn :as edn] | |
[clojure.string :as str] |
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
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
usage() { | |
cat <<EOF |
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
;; http://lists.gnu.org/archive/html/help-gnu-emacs/2007-05/msg00975.html | |
(defvar sticky-buffer-previous-header-line-format) | |
(define-minor-mode sticky-buffer-mode | |
"Make the current window always display this buffer." | |
nil " sticky" nil | |
(if sticky-buffer-mode | |
(progn | |
(set (make-local-variable 'sticky-buffer-previous-header-line-format) |
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/sh | |
zcfg () | |
{ | |
local URL; | |
if [[ $# -lt 1 ]]; then | |
defaults read ZoomChat conf.webserver; | |
else | |
defaults write ZoomChat com.zoom.client.zclist ""; | |
case $1 in |
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
#!/usr/bin/env bash | |
# Import SSH keys from Github to ~/.ssh/authorize_keys for all members of a | |
# given Github organization. | |
# | |
# Will replace authorized_keys, if it looks like authorized_keys was not | |
# previously created by this script then a backup copy is made. | |
# | |
# Depends on jq, will download it if not available (assumes Linux) to ~/bin/jq | |
# |
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 poly | |
(:require | |
[clojure.string :as str])) | |
;; ===================================================== | |
;; what is a good way to do polymorphism on an example like this: | |
;; ===================================================== | |
(defn transform-messages [messages] | |
(map #(update % :text str/upper-case) messages)) |