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
" Quickly toggle between relative and no relative line numbers | |
function! NumberToggle() | |
if(&relativenumber == 1) | |
set norelativenumber | |
else | |
set relativenumber | |
endif | |
endfunc | |
nnoremap <C-L> :call NumberToggle()<CR> |
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
import System.Directory | |
import System.Environment | |
import System.IO | |
import Control.Monad | |
import Data.List | |
dispatch :: [(String, [String] -> IO ())] | |
dispatch = [ ("add", add) | |
, ("view", view) | |
, ("remove", remove) |
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
using System.Net.Http; | |
using System.Text; | |
using System.Web.Http; | |
using Twilio.TwiML; | |
using ValidateRequestExample.Filters; | |
namespace ValidateRequestExample.Controllers | |
{ | |
public class TwilioMessagingRequest | |
{ |
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
using Microsoft.AspNetCore.Mvc; | |
using Twilio.TwiML; | |
using ValidateRequestExample.Filters; | |
namespace ValidateRequestExample.Controllers | |
{ | |
public class IncomingController : Controller | |
{ | |
[ValidateTwilioRequest] | |
[Produces("text/xml")] |
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
# Factorial | |
# Keep in mind we want to remove assignment. | |
ZERO = ->(_) { ->(x) { x } } | |
# ONE = ->(f) { ->(x) { f[x] } } | |
TWO = ->(f) { ->(x) { f[f[x]] } } | |
THREE = ->(f) { ->(x) { f[f[f[x]]] } } | |
ADD0 = ->(n) { ->(f) { ->(x) { n[f][x] } } } | |
SUCC = ->(n) { ->(f) { ->(x) { f[n[f][x]] } } } |
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
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4VsqRXhpZgAATU0AKgAAAAgAFgEPAAIAAAAGAAABFgEQAAIAAAAMAAABHAESAAMAAAABAAEAAAEaAAUAAAABAAABKAEbAAUAAAABAAABMAEoAAMAAAABAAIAAAEyAAIAAAAUAAABOAE7AAIAAAABAAAAAAITAAMAAAABAAIAAIKYAAIAAAABAAAAAIdpAAQAAAABAAABTIglAAQAAAABAAA5uIgwAAMAAAABAAIAAIgyAAQAAAABAAAGQJAQAAIAAAAHAAA5zJARAAIAAAAHAAA51JASAAIAAAAHAAA53KQwAAIAAAABAAAAAKQxAAIAAAANAAA55KQyAAUAAAAEAAA58qQ0AAIAAAAcAAA6EqQ1AAIAAAALAAA6LgAAOjpDYW5vbgBDYW5vbiBFT1MgUgAAAABIAAAAAQAAAEgAAAABMjAxODowNDoyMiAwNzo1NzoxMAAAIIKaAAUAAAABAAAC0oKdAAUAAAABAAAC2ogiAAMAAAABAAIAAIgnAAMAAAABBkAAAJAAAAcAAAAEMDIzMZADAAIAAAAUAAAC4pAEAAIAAAAUAAAC9pEBAAcAAAAEAQIDAJIBAAoAAAABAAADCpICAAUAAAABAAADEpIEAAoAAAABAAADGpIHAAMAAAABAAUAAJIJAAMAAAABAAAAAJIKAAUAAAABAAADIpJ8AAcAADVWAAADKpKGAAcAAAEIAAA4gJKQAAIAAAADNzMAAJKRAAIAAAADNzMAAJKSAAIAAAADNzMAAKAAAAcAAAAEMDEwMKABAAMAAAABAAEAAKACAAMAAAABDSAAAKADAAMAAAABCMAAAKAFAAQAAAABAAA5iKIOAAUAAAABAAA5qKIPAAUAAAABAAA5sKIQAAMAAAABAAIAAKQBAAMAAAABAAAAAKQCAAMAAAABAAAAAKQDAAMAAAABAAAAAKQGAAMAAAABAAAAAOodAAkAAAABAAAAAAAAA |
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
# section :: [a] -> [Int] -> [[a]] | |
section = lambda { |arr:, lengths:| | |
starts = [*0..lengths.size - 1].reduce([]) do |acc, idx| | |
acc << lengths.take(idx).sum; acc | |
end | |
starts.zip(lengths).map { |start, lenght| arr.slice(start, lenght) } | |
} | |
arr = [*1..100] |
OlderNewer