In haskell, `div`
is integer only division. code is nice, see?
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
// https://www.codingame.com/training/easy/temperatures | |
// gcc -std=c99 -Wall -pedantic -o temperatures temperatures.c | |
// ./temperatures <<< $(cat input.txt) | |
// | |
// input.txt | |
// 9 | |
// 7 22 -99 0 -1 35 -2 +7654 21 | |
#include <stdio.h> | |
#include <stdlib.h> |
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/bash | |
find ./ -name '*.php' -o -name '*.html' -o -name '*.css' -o -name '*.js' -type f | | |
while read file | |
do | |
echo " $file" | |
mv $file $file.icv | |
iconv -f ISO-8859-1 -t UTF-8 $file.icv > $file | |
rm -f $file.icv | |
done |
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 | |
usage() { | |
printf "\nUsage: ${0##*/} path session\n\n" | |
printf " path: a path like \`~/projs/foo\`\n" | |
printf " session: a name for the session tmux will create\n" | |
} | |
if (($# < 2)); then | |
usage | |
exit 1 |
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
INSERT INTO images ( | |
post_id | |
, extension | |
, position | |
, created_at) | |
(SELECT | |
'13' | |
, 'jpg' | |
, COALESCE(MAX(position), 0) + 1 | |
, CURRENT_TIMESTAMP |
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 | |
# Place where I manipulate files when I an studying my Anki cards | |
# and need to run quick snippets of code to assert my knowledge of | |
# the things I am committing to the long-term memory. | |
temp_study_dir="${HOME}/Public/tempstudyfiles" | |
if [ ! -d "$temp_study_dir" ] ; then | |
mkdir --parent "$temp_study_dir" | |
cd "$temp_study_dir" |
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
(defun my/toggle-org-emph () | |
"Toggles showing of org mode markup like ~, /, * etc." | |
(interactive) | |
(when (eq major-mode 'org-mode) | |
(if (and org-hide-emphasis-markers) | |
(progn | |
(print "Hiding org-mode emphasis markers") | |
(setq org-hide-emphasis-markers nil) | |
(org-mode)) | |
(progn |
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
━━━━━━━━━━━━━━━━ | |
EMACS SUMMARY | |
Fernando Basso | |
━━━━━━━━━━━━━━━━ | |
Table of Contents | |
───────────────── |
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
━━━━━━━━━━━━━━━━ | |
HASKELL-NOTES1 | |
Fernando Basso | |
━━━━━━━━━━━━━━━━ | |
Table of Contents | |
───────────────── |
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 | |
#tmux new-session -d -s rails 'title rails-development; stty -ixon; vim' | |
cd ~/develop/projs/html5-audio-player-typescript | |
title oswp | |
tmux new-session -d -s oswp | |
# For some reason, send-keys does nothing here, not even an error is displayed. |