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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <assert.h> | |
int main(int argc, char* argv[]) { | |
int idim = 3; | |
int jdim = 4; |
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
''' | |
Set ANSI Terminal Color and Attributes. | |
''' | |
from sys import stdout | |
esc = '%s['%chr(27) | |
reset = '%s0m'%esc | |
format = '1;%dm' | |
fgoffset, bgoffset = 30, 40 | |
for k, v in dict( |
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
fun! pymode#Toggle(toggle, msg) "{{{ | |
let {a:toggle} = {a:toggle} ? 0 : 1 | |
if {a:toggle} | |
echomsg a:msg." enabled" | |
else | |
echomsg a:msg." disabled" | |
endif | |
endfunction "}}} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
def crank(V, L1, R1x, L2, R2x, dt, n, crumbs=[], callback=None): | |
V = V.copy() | |
dt *= 0.5 | |
L1e = flatten_tensor(L1) | |
L1i = L1e.copy() | |
R1 = np.array(R1x).T | |
L2e = flatten_tensor(L2) | |
L2i = L2e.copy() |
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
module Main where | |
import Control.Comonad.Cofree | |
import Control.Lens | |
import Numeric.AD | |
import Numeric.AD.Types | |
import Text.Printf (printf) | |
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 webview.init_funcs.mailto_hook (view, w) | |
view:add_signal("navigation-request", function (v, uri) | |
if string.match(string.lower(uri), "^mailto:") then | |
luakit.spawn(string.format("%s %q", "urxvtc -title mutt -e mutt", uri)) | |
return false | |
end | |
end) | |
end |
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
#!/usr/bin/env python | |
import urllib | |
import urllib2 | |
import sys | |
if len(sys.argv) > 1: | |
lang = sys.argv[1] | |
else: |
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
<hiptobecubic> @src Maybe | |
<lambdabot> data Maybe a = Nothing | Just a | |
<hiptobecubic> @src Monad | |
<lambdabot> class Monad m where | |
<lambdabot> (>>=) :: forall a b. m a -> (a -> m b) -> m b | |
<lambdabot> (>>) :: forall a b. m a -> m b -> m b | |
<lambdabot> return :: a -> m a | |
<lambdabot> fail :: String -> m a | |
<hiptobecubic> @src [] (>>) | |
<lambdabot> xs >> ys = concatMap (const ys) xs |
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
#!/usr/bin/env sh | |
# Download lists, unpack and filter, write to stdout | |
curl -s https://www.iblocklist.com/lists.php \ | |
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \ | |
| xargs wget -O - \ | |
| gunzip \ | |
| egrep -v '^#' |