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 recaman | |
([] | |
(recaman 1 1 #{1})) | |
([n prev visited] | |
(lazy-seq | |
(cons prev | |
(let [n (inc n) | |
next (let [lookup (- prev n)] | |
(if (and (pos? lookup) (nil? (visited lookup))) | |
lookup |
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 divisible? [divisor number] | |
(zero? (mod number divisor))) | |
(defn fizzbuzz [n] | |
(case [(divisible? 3 n) (divisible? 5 n)] | |
[true false] "Fizz" | |
[false true] "Buzz" | |
[true true] "FizzBuzz" | |
n)) |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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
from urllib.parse import urlencode | |
import json | |
import logging | |
import urllib.request as urlrequest | |
import re | |
import os | |
log = logging.getLogger() | |
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
# Install homebrew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# desktop applications | |
brew install --cask firefox | |
brew install --cask chrome | |
brew install --cask dropbox | |
brew install --cask notion | |
brew install --cask 1password |
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 | |
MYSQL=`mysql --defaults-file=/etc/mysql/debian.cnf -e "SHOW GLOBAL STATUS LIKE 'Slave_running'" | grep 'Slave_running' | awk '{ print $2 }'` | |
res="$MYSQL" | |
if [ $res != "ON" ]; then | |
touch replication.broken | |
echo 'Replication was broken' | /usr/bin/mail -s 'echo 'Replication was broken' | /usr/bin/mail -s "[`hostname`] Replication was broken"' [email protected] | |
fi | |
#MYSQL=`mysql --defaults-file=/etc/mysql/debian.cnf -e "SHOW SLAVE STATUS\G"` |
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 | |
REPO= | |
BRANCH=Release | |
DB=bom_$(date +%Y%m%d) | |
set -x | |
cd /htdocs/dev/repo/release | |
NewerOlder