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
class PolynomialRegression(BaseEstimator): | |
def __init__(self, degree=2): | |
self.features = PolynomialFeatures(degree=degree) | |
self.model = LinearRegression() | |
def get_params(self, deep=True): | |
return {'degree': self.features.degree} | |
def set_params(self, **params): |
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 { XY } from './types'; | |
export const setupTouch = ( | |
container: HTMLElement, | |
animate: () => void, | |
tapped: (position: XY) => void, | |
panned: (delta: XY) => void, | |
pinched: (delta: number) => void, | |
) => { | |
const ctx = { |
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
defmodule Test do | |
# runs command and logs outputs when they become available, mostly useful for long running commands that | |
# provide incremental output as the command progresses | |
def run_command_and_log!(host, conn, command) do | |
res = Enum.reduce( | |
SSHEx.stream(conn, command, channel_timeout: 10_000, exec_timeout: 3_600_000), | |
%{:status => nil,:stdout => [], :stderr => []}, | |
fn (x, acc) -> | |
case x do | |
{:stdout, row} -> |
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::{env, io::Error as IoError, net::SocketAddr}; | |
use futures_util::StreamExt; | |
use tokio::net::{TcpListener, TcpStream}; | |
use tokio_tungstenite::accept_async; | |
use tungstenite::Error; | |
async fn handle_connection(raw_stream: TcpStream, addr: SocketAddr) -> tungstenite::Result<()> { |
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
val ctx = Context.newBuilder() | |
.allowAllAccess(true) | |
.build() | |
@Language("Python") val script = """ | |
import polyglot | |
@polyglot.export_value | |
def main(x): | |
return x + 1 | |
""".trimIndent() |
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=$'\n' | |
PROMPT+=' %{$fg[yellow]%}%n@%m%{$reset_color%}' | |
PROMPT+=' %{$fg[cyan]%}%~%{$reset_color%} $(git_prompt_info)' | |
PROMPT+=$'\n'" " | |
PROMPT+="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )" | |
PROMPT+="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗" |