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 stack | |
{- stack --resolver lts-17.4 script | |
--package=typed-process | |
--package=filepath | |
--package=modern-uri | |
--package=text | |
-} | |
{-# LANGUAGE OverloadedStrings #-} |
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
prompt("Copy", [...document.getElementsByClassName('listItemTitle')].map(e => e.innerText).join("\n")) |
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
const input = document.getElementsByClassName("listItemInput")[0]; | |
const form = document.getElementsByClassName("addForm")[0]; | |
function addItem(name){ | |
input.dispatchEvent(new Event("focus")); | |
input.value = name; | |
input.dispatchEvent(new Event("input")); | |
form.dispatchEvent(new Event("submit")); | |
} |
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! Denite_do_open(split_cmd, context) abort | |
execute(a:split_cmd) | |
call denite#do_action(a:context, 'open', a:context['targets']) | |
endfunction | |
call denite#custom#action('openable,file,buffer,directory', 'left', funcref('Denite_do_open', ['leftabove vsplit'])) | |
call denite#custom#action('openable,file,buffer,directory', 'below', funcref('Denite_do_open', ['rightbelow split'])) | |
call denite#custom#action('openable,file,buffer,directory', 'above', funcref('Denite_do_open', ['leftabove split'])) | |
call denite#custom#action('openable,file,buffer,directory', 'right', funcref('Denite_do_open', ['rightbelow vsplit'])) |
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
.text | |
.global _start | |
_start: | |
MOV X0, #65 | |
MOV X8, #93 | |
SVC 0 |
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/env stack | |
{- | |
stack script --resolver=lts-14.6 | |
--package=mtl | |
--package=containers | |
-} | |
{-# OPTIONS -fdefer-type-errors #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE RankNTypes #-} |
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
/* | |
fact :: Int -> Integer | |
fact 0 = 1 | |
fact n = fromIntegral n * fact (n-1) | |
*/ | |
const fact = function(n){ | |
if (n == 0){ | |
return 1; | |
} else { | |
return n * fact(n - 1); |
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
import Data.Bits | |
import Data.Word | |
import Data.STRef | |
import Control.Monad.ST | |
import Data.Function | |
import Test.Hspec | |
import Test.Hspec.QuickCheck |
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" | |
int main() | |
{ | |
int array[5]; | |
int *p; | |
int i; | |
p = array; /* p = &array[0] と同じ */ | |
for (i = 0; i < 5; i++) { |
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
switch(location.hostname){ | |
case 'twitter.com': | |
location.href = location.href.replace(/^https:\/\/twitter/, 'https://mobile.twitter'); | |
break; | |
case 'mobile.twitter.com': | |
location.href = location.href.replace(/^https:\/\/mobile\.twitter/, 'https://twitter'); | |
break; | |
} |