Skip to content

Instantly share code, notes, and snippets.

View levlaz's full-sized avatar

Lev Lazinskiy levlaz

View GitHub Profile
@levlaz
levlaz / main.go
Created January 9, 2024 15:13
Direct Call
package main
import (
"log"
"os"
"os/exec"
)
func main() {
cmd := exec.Command("dagger", "call", "-m", "github.com/shykes/daggerverse/hello", "message")
@levlaz
levlaz / main.go
Created October 10, 2023 14:54
Dagger + Hugo
package main
import (
"context"
"fmt"
"os"
"path/filepath"
"dagger.io/dagger"
)
```
Caught panic:
runtime error: slice bounds out of range [7:5]
Restoring terminal...
goroutine 1 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x65
@levlaz
levlaz / app.js
Last active May 26, 2021 01:25
React Hook Demo with Form Handling
import { Route, Switch } from 'react-router-dom';
import HooksDemo from './hooksDemo';
import React from 'react';
import { withLDProvider } from 'launchdarkly-react-client-sdk';
const App = () => (
<div>
<main>
<Switch>
@levlaz
levlaz / conf.yml
Last active August 3, 2021 02:41
Nonsense logs with PII
logs:
- type: file
path: "tmp/sample_logger.log"
service: "nf"
@levlaz
levlaz / main.java
Created July 24, 2019 23:52
Java Relay Snippet
import com.launchdarkly.client.LDClient;
import com.launchdarkly.client.LDConfig;
import com.launchdarkly.client.LDUser;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import static java.util.Collections.singletonList;
@levlaz
levlaz / ubuntu.md
Last active July 11, 2019 02:51
Ubuntu Init Notes

Add New User

adduser $USERNAME

Make vim default editor

sudo update-alternatives --config editor
@levlaz
levlaz / vscode.md
Created July 2, 2019 02:36
VS Code Config Notes

Add vertical ruler

This is helpful to see when you are about to go over 80 characters.

In settings.json

{
    "editor.rulers": [80]
}
@levlaz
levlaz / git.md
Created July 2, 2019 02:35
Git Cheat Sheet

Force SSH for Git Checkout

This comes up when you do go get with a private repo; it wants a username/pass instead of using your key.

git config --global url.ssh://git@github.com/.insteadOf https://github.com/
@levlaz
levlaz / programming_styles.py
Created April 12, 2019 19:36
Python Three Ways
"""
Python three ways
Print the numbers 1 - 10 in procedural, functional, and
object oriented styles.
"""
# Procedural
print(1)
print(2)