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
// ==UserScript== | |
// @name Custom Key Bindings for Chat.OpenAI | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Add custom key bindings to Chat.OpenAI | |
// @author You | |
// @match https://chat.openai.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com | |
// @grant none | |
// ==/UserScript== |
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
use tokio::{ | |
io::{AsyncBufReadExt, AsyncWriteExt, BufReader}, | |
net::TcpListener, | |
sync::broadcast, | |
}; | |
#[tokio::main] | |
async fn main() { | |
let listener = TcpListener::bind("localhost:8080").await.unwrap(); |
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
from typing import Optional | |
class Node: | |
def __init__(self, data): | |
self.left: Optional[Node] = None | |
self.right: Optional[Node] = None | |
self.data = data | |
def printTree(self): |
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
use std::collections::HashMap; | |
use std::hash::Hash; | |
struct Cacher<T, U, V> | |
where | |
T: Fn(U) -> V, | |
U: Hash + Eq + Clone, | |
V: Copy, | |
{ | |
calculation: T, |
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
fn two_sum(nums: Vec<i32>, target: i32) -> Vec<i32> { | |
let mut map: HashMap<i32, i32> = HashMap::new(); | |
for (i, num) in nums.iter().enumerate() { | |
let complement: i32 = target - nums[i]; | |
let i_i32 = i as i32; | |
if map.contains_key(&complement) { | |
let map_complement = *map.get(&complement).unwrap(); |
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
/* The function takes some set of data (preferable structural types), and assuming some | |
* default expectations of output (in my case, fields to be 'text' and 'value - returns back adapter structure */ | |
/* Used GOF Patterns - Adapter and Strategy */ | |
export default function adaptToList(data = [], textField = '', valueField = '') { | |
if (!data.length) { | |
return []; | |
} |
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 React, { PureComponent } from 'react'; | |
import { Grid } from 'styled-css-grid'; | |
import styled from 'styled-components'; | |
import { theme } from 'utils'; | |
import { Header, Content } from 'components'; | |
const Container = styled.div` | |
padding: ${({ padding }) => padding ? `${padding}px` : '0'} 200px; | |
`; |
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 React, { Component } from 'react'; | |
import { reduxForm, Field } from 'redux-form'; | |
import PropTypes from 'prop-types'; | |
import {Title, Input, Button} from '../../../elements'; | |
import { | |
Description, | |
StyledTitle, | |
DescriptionWrapper, | |
Container |
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 React, {Component} from 'react'; | |
import SearchIcon from '../../icons/search-icon'; | |
import { | |
SearchInputView, | |
IconContainer, | |
InputView, | |
StyledInput, | |
StyledText | |
} from './styles'; |
NewerOlder