on:
push:
pull_request:
branches: [main]
jobs:
build:
strategy:
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/bash | |
LOGFILE="$HOME/projects/dotfiles/work_track_time" | |
#disables the error if the directory exists, creates parent directories if needed | |
mkdir -p $(dirname $LOGFILE) | |
_format_task () { | |
# The assignment asks us to convert the time to HH:MM:SS, but also to make sure it runs correctly if the task exeeceds 24H. | |
# I choose to optionally render the time as D:HH:MM:SS if the time exceedes 24H. | |
local T=$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
#!/usr/bin/env python3 | |
import json | |
with open("./target.json", "r") as file: | |
target_file = json.load(file) | |
for t in target_file["SearchWord"]: | |
prefix = {"create": {"_index": "searchword", "_type": "_doc"}} | |
words = { | |
"word": t["SearchWord"], |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<style> | |
body { | |
margin: 0; | |
background: black; |
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 { Module, NestModule } from '@nestjs/common'; | |
import { TypeOrmModule } from '@nestjs/typeorm'; | |
@Module({ | |
imports: [ | |
TypeOrmModule.forRoot({ | |
...{ | |
type: 'mongodb', | |
url: '<your-mongo-db-atlas-url-here>', | |
synchronize: false, |
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
" ________________ COC.NVIM ________ | |
let g:coc_global_extensions = ['coc-json', | |
\ 'coc-git', | |
\ 'coc-snippets', | |
\ 'coc-tsserver', | |
\ 'coc-eslint', | |
\ 'coc-rust-analyzer', | |
\ 'coc-cssmodules', | |
\ 'coc-marketplace', | |
\ 'coc-java', |
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/sh | |
pushd "$(git rev-parse --show-toplevel)" &>/dev/null | |
get_package_manager() { | |
if [[ -f "yarn.lock" ]]; then | |
echo "yarn" | |
elif [[ -f "package-lock.json" ]]; then | |
echo "npm" | |
elif [[ -f "pnpm-lock.yaml" ]]; then |
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
package main | |
import ( | |
"database/sql" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"os" | |
_ "github.com/lib/pq" |
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
local function getLastDirectory(fullPath) | |
-- Replace "file:////" with an empty string to remove it from the path | |
local cleanPath = string.gsub(fullPath, "file:////", "") | |
-- Separate the path using the directory separator "/" | |
local directories = {} | |
for directory in string.gmatch(cleanPath, "[^/]+") do | |
table.insert(directories, directory) | |
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
use std::error::Error; | |
use actix_web::{get, App, HttpResponse, HttpServer}; | |
use leptos::*; | |
const PORT: u16 = 4000; | |
#[get("/")] | |
async fn hello() -> Result<HttpResponse, Box<dyn Error>> { | |
let html = leptos::ssr::render_to_string(move |ctx| { |
OlderNewer