module Mixin
def def_a_method
define_method(:foo) { puts 'mixin' }
end
end
class Thing
This file contains 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 ob-python--eval-python-session-with-exceptions | |
(orig session body &rest args) | |
(let* ((exc-file (make-temp-file "session-exception"))) | |
(unwind-protect | |
(let* ((body (format "\ | |
try: | |
%s | |
except: | |
import traceback |
This file contains 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
use std::thread; | |
use std::time::Instant; | |
use std::{sync::Arc, time::Duration}; | |
use tokio::select; | |
use tokio::sync::broadcast; | |
use tokio::time::sleep; | |
const BUFFER_SIZE: usize = 64; |
This file contains 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
2020-07-03 16:47:38.104119755 [ThreadId 5] - | |
haskell-lsp:Starting up server ... | |
2020-07-03 16:47:38.104424879 [ThreadId 5] - ---> {"jsonrpc":"2.0","method":"initialize","params":{"processId":null,"rootPath":"/home/grfn/code/depot","clientInfo":{"name":"emacs","version":"GNU Emacs 27.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.13)"},"rootUri":"file:///home/grfn/code/depot","capabilities":{"workspace":{"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"]},"applyEdit":true,"symbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":false},"workspaceFolders":true,"configuration":true},"textDocument":{"declaration":{"linkSupport":true},"definition":{"linkSupport":true},"implementation":{"linkSupport":true},"typeDefinition":{"linkSupport":true},"synchronization":{"willSave":true,"didSave":true,"willSaveWaitUntil":true},"documentSymbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8 |
This file contains 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
{ fetchFromGitHub | |
, buildPythonPackage | |
, notmuch | |
, pygobject2 | |
, notify2 | |
, gobject-introspection | |
, libnotify | |
, pyinotify | |
, notify | |
}: |
This file contains 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
{ fetchFromGitHub | |
, python | |
, maturin | |
, arrow | |
, dataclasses | |
, numpy | |
, pendulum | |
, psutil | |
, pytest | |
, pytz |
This file contains 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
benchmarking Binary Encoding/big data/Data.Binary | |
time 216.2 ms (183.5 ms .. 245.8 ms) | |
0.993 R² (0.978 R² .. 1.000 R²) | |
mean 162.9 ms (136.6 ms .. 184.9 ms) | |
std dev 26.37 ms (20.48 ms .. 30.39 ms) | |
variance introduced by outliers: 38% (moderately inflated) | |
benchmarking Binary Encoding/big data/Codec.Serialise | |
time 218.2 ms (186.3 ms .. 246.4 ms) | |
0.993 R² (0.979 R² .. 1.000 R²) |
This file contains 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
{-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, DeriveAnyClass, FunctionalDependencies, DeriveGeneric #-} | |
module Lib where | |
import Control.Lens | |
import Control.Monad.Writer | |
import Control.Monad.Except | |
import Data.Monoid | |
import GHC.Generics |
This file contains 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
function instance_by_name() { | |
aws ec2 describe-instances \ | |
--filters "Name=tag:Name,Values=$1" \ | |
| jq -r '.Reservations | map(.Instances) | flatten | map(.NetworkInterfaces) | flatten | map(.Association.PublicIp) | first' | |
} | |
SSH_KEY="/path/to/ssh/key" | |
alias staging='ssh -i $SSH_KEY ec2-user@$(instance_by_name staging)' | |
alias production='ssh -i $SSH_KEY ec2-user@$(instance_by_name production)' |
This file contains 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 | |
echo -en "¯\\_(\xe3\x83\x84)_/¯" | xsel | |
xdotool key Shift+Insert |
NewerOlder