Trending

#DevTip

Latest posts tagged with #DevTip on Bluesky

Latest Top
Trending

Posts tagged #DevTip

Cisco DevNet tip: Use Makefiles as universal command interface for projects

Cisco DevNet tip: Use Makefiles as universal command interface for projects

Three developers running different podman commands with inconsistent syntax and volume mounts

Three developers running different podman commands with inconsistent syntax and volume mounts

Makefile with WORKSPACE variable allowing same 'make collect' command across laptop and CI/CD

Makefile with WORKSPACE variable allowing same 'make collect' command across laptop and CI/CD

Makefile using uv sync frozen for reproducible results across development and CI/CD

Makefile using uv sync frozen for reproducible results across development and CI/CD

Makefiles: underrated for non-build workflows.

make install → uv sync
make test → pytest + lint
make deploy → ansible

Same commands locally + CI/CD. Simple, printable, debuggable (1976 Unix ethos). Boring tech that works. 💪

P.S. Image style = Lions book homage 📘

#CiscoDevNet #DevTip

0 0 0 0
Cisco DevNet tip: uv - one tool to replace pip, venv, pyenv, and poetry for Python

Cisco DevNet tip: uv - one tool to replace pip, venv, pyenv, and poetry for Python

Terminal showing traditional Python setup with venv, pip install, and comments listing four different tools needed

Terminal showing traditional Python setup with venv, pip install, and comments listing four different tools needed

Terminal showing uv init and uv add commands with automatic virtual environment creation

Terminal showing uv init and uv add commands with automatic virtual environment creation

Terminal showing uvx command running Ansible playbook without prior installation

Terminal showing uvx command running Ansible playbook without prior installation

Python environment management solved: uv

One tool replaces pip, venv, pyenv, poetry. 10-100x faster.

uvx runs tools without installing - from PyPI or GitHub.

⚠️ Verify sources, it's code from the internet.

uv docs: cs.co/633297hxUd

#CiscoDevNet #DevTip #Python

3 0 0 0

Tip of the week:
There is only so much you can test in development.

Expect the unexpected and expect it to break.

#DevTip

0 0 0 0
Cisco DevNet tip: Use purpose built container base images - less bloat, less risk

Cisco DevNet tip: Use purpose built container base images - less bloat, less risk

Terminal showing cat Dockerfile.ubuntu with ubuntu:latest base and podman images output showing 622 MB

Terminal showing cat Dockerfile.ubuntu with ubuntu:latest base and podman images output showing 622 MB

Terminal showing cat Dockerfile.slim with python:3.11-slim base and podman images output showing 199 MB

Terminal showing cat Dockerfile.slim with python:3.11-slim base and podman images output showing 199 MB

Summary: Purpose built images mean only what you need, smaller attack surface, predictable builds, and faster deploys

Summary: Purpose built images mean only what you need, smaller attack surface, predictable builds, and faster deploys

Your container only needs what your app needs.

General purpose base images include hundreds of packages you'll never use each one a potential vulnerability and something to maintain.

Purpose built images: Smaller footprint. Faster deploys. Fewer vulnerabilities.

#CiscoDevNet #DevTip #Containers

0 0 0 0
Cisco DevNet holiday tip: Terminal Cheer with cowsay ASCII art

Cisco DevNet holiday tip: Terminal Cheer with cowsay ASCII art

Terminal showing cowsay ASCII cow saying 'May your uptime be high and your latency low'

Terminal showing cowsay ASCII cow saying 'May your uptime be high and your latency low'

Terminal showing cowsay with Tux penguin saying 'Happy Holidays'

Terminal showing cowsay with Tux penguin saying 'Happy Holidays'

Holiday message: May your packets find their way home. Add fortune cowsay to bashrc for daily smiles.

Holiday message: May your packets find their way home. Add fortune cowsay to bashrc for daily smiles.

Holiday terminal tip

`fortune | cowsay`

Random wisdom in ASCII art. Been hiding in Unix since 1979 (fortune) and 1999 (cowsay).

Add it to `.bashrc` for daily login cheer, or set it as your team's MOTD.

Happy holidays—may your packets find their way home 🏠

#CiscoDevNet #DevTip #Linux

0 0 0 0
Code Archaeology

Code Archaeology

Step 1. Git Blame

Step 1. Git Blame

Step 2. Git Show

Step 2. Git Show

Understanding What Changed and Why

Understanding What Changed and Why

Debugging tip: git blame + git show is an underrated combo

git blame <file> → see which commit changed each line
git show <hash> → read the commit message and full diff

Only works if commits have context. "Fixed bug" = useless
"Increase timeout for slow WAN links" = gold

#CiscoDevNet #DevTip #Git

0 0 0 0
CLI over API

CLI over API

CLI RPC via RESTCONF

CLI RPC via RESTCONF

NX-OS: NX-API CLI

NX-OS: NX-API CLI

IOS-XR: gNMI + ASCII

IOS-XR: gNMI + ASCII

CLI-over-API varies by Cisco platform:

• IOS-XE: CLI RPC (config commands, works over NETCONF/RESTCONF/gRPC)
• NX-OS: NX-API CLI (show + config, JSON output)
• IOS-XR: gNMI with ASCII encoding

Different transports, same idea.

#CiscoDevNet #DevTip #NetworkAutomation

2 0 0 0
CLI Parse & Pray. Text Parsing Pain

CLI Parse & Pray. Text Parsing Pain

API RESTCONF Structured Data

API RESTCONF Structured Data

API RESTCONF HTTP Verbs

API RESTCONF HTTP Verbs

API RESTCONF Patch

API RESTCONF Patch

Network automation tip: RESTCONF for structured device data.

Skip the CLI text parsing. Query Cisco devices via HTTP, get JSON back. Works consistently across IOS-XE/XR/NX-OS.

Test free: cs.co/633257UNMW

#CiscoDevNet #DevTip #NetworkAutomation #RESTCONF

0 0 0 0
One character saves hours of typing

One character saves hours of typing

Toggle between directories

Toggle between directories

Swtich to previous branch

Swtich to previous branch

CLI efficiency tip: The `-` character is a "previous location" shortcut in bash and git.

cd - (returns to previous dir)
git checkout - (previous branch)

Simple pattern that saves countless keystrokes in toggle-heavy workflows.

#CiscoDevNet #DevTip #CLI #DevOps

0 0 0 0
The Risky Way. Access directly the dictionary

The Risky Way. Access directly the dictionary

A Safer Way. Use the dictionary GET method

A Safer Way. Use the dictionary GET method

Best Practice. Set a default value on the GET Method

Best Practice. Set a default value on the GET Method

Launching a new weekly #DevTip series! 💡

Instead of `data['key']` which raises a `KeyError`, use `data.get('key', 'default_value')`. This makes parsing varied JSON/YAML from network devices much more robust.

What topics should we cover in this series?

#CiscoDevNet #DevTip #NetworkAutomation

1 0 0 0

I recently learned about this concept
*Idempotency*
​Idempotency = 1 call or 100 calls, same result. 🔄
​It's what stops a failed payment retry from becoming a double charge. 💳🚫
​Vital for robust APIs. Build for retries, not just the happy path. 🛠️✅
#programming #devtip #api

2 0 0 0
Post image

Pro tip: 💁📊

❌ Understanding plain charts can take time
✅ Make charts easier by mapping related values

24 different values → 5 semantic groups
= way more readable charts each time you look at them!

Learn more: 👇
telemetrydeck.com/blog/mapping...

#DataDriven #iOSDev #SwiftUI #DevTip #AppAnalytics

2 0 0 0
Post image

DAILY REMINDER 💡
Keep building, even if no one is watching.
The right people will notice when the time is right. 🚀

#devtip #programming #consistency #growth #buildinpublic

3 1 0 0

🔒 $hidden won’t protect a property of a model if you access it manually in an API Resource. Need control? Use separate resources.
#Laravel #APIResource #PHP #DevTip

0 0 0 0

Dein Kalender muss dir heilig sein.

Überprüfe regelmäßig regelmäßige Termine – und werd sie im Zweifel los.
Sprich mit deinem Manager und Product Owner darüber.

#TimeManagement #FocusTime #FromJuniorToSenior #DevTip #Leadership

1 0 0 0
Post image Post image

Sharing two practice how to optimize Server-Side Rendering:

1)Request-Level Caching (usually implemented along with serverless redis or some serverless key-value storages)

2)Parallel Data Fetching

#Nextjs #WebDev #FrontendInfra #DX #Frontend #DevTip #Vercel #React

1 0 0 0
CLI 도구로 나만의 요술봉 만들기 (feat. Ruby) > 본론으로 들어가기에 앞서, 이 글에서는 Bash 스크립트에다가 Ruby를 섞어서 사용하는 트릭을 서술할 예정인데, 다른 스크립팅 언어로도 해낼 수 있음을 강조해둔다. * 쉘스크립트로 어떻게 워크플로우를 개선할 수 있을까? * 어떻게 하면 CLI 도구를 잘 사용할 수 있을까? 이런 고민들, 누군가는 했을 것이다. 이 글을 읽는 여러분은 한번씩은 거치고도 남았을 것이다. 이 글에서는 간단한 커맨드의 조합만으로도 여러분의 삶을 바꿀지도 모르는 비법을 소개하고자 한다. Bash 스크립트를 잘 짜는 방법을 안다면 분명 도움이 되는 구석이 많다. OpenBSD, 리눅스 등을 기반한 어지간한 OS에서는 Bash 스크립트를 지원하기도 하니까 말이다. 하지만, Bash 스크립트 단독으로는 가독성이 떨어지기도 하고, 일회성으로 짠다면 더더욱 직관적으로 와닿는 코드를 짜기도 어렵다. 하지만, Ruby나 Perl 등의 스크립트와 함께라면 그나마 좀 더 가독성이 있는 스크립트를 짤 수 있게 된다. ## 그렇다면 왜 Bash 대신 Ruby인가? Bash를 사용해서 스크립트 짜는 것이 원론적인 접근이고, 많은 곳에서 스크립트를 짤 때 권장하고 있다. 가능하면 외부 소프트웨어와의 의존성을 줄여야 하고, 어디서든 돌아가는 스크립트를 짜야하기 때문이다. 하지만, 내 개발환경에서만 돌리는 일회성의 스크립트라면? Ruby 정도는 섞어서 써도 괜찮다. 사실상 답정너이긴 하지만, 왜 Ruby로 스크립트를 짜는 것이 도움이 되는가? 왜, 꼭 Ruby를 써야하는가? 이유를 나열하자면 아래와 같다. * **자료형을 다루는 데 있어서 타입 구분이 확실하다** * 내가 다루는 데이터가 어떤 자료형인지 긴가민가한 Bash 스크립트에 비해, Integer/Float/String/Hash/Array 등 명시적으로 구분되는 자료형으로 확실하게 구분되는 점에 감사할 수 있다. * 여러분이 macOS를 사용하고 있다면, **homebrew가 깔려있다면, 사실상 Ruby는 기본으로 딸려오는 옵션** 이라고 보면 된다. * (macOS 유저 한정으로) **빌드 스크립트를 짜는데 요긴하게 도움이 될 수 있다.** * XCode에서 빌드할때 CocoaPod를 사용하는데, 내부적으로 Ruby 스크립트로 구성이 되어 있다. 또한 Fastlane에서 빌드 스크립트를 작성할때 Ruby를 사용한다. 유사한 작업을 할 때 지식이 전이될 수 있다. * **JSON/CSV/YAML을 다루는 라이브러리가 표준라이브러리로서 내장이 되어 있다.** 이를 어떻게 다룰 수 있는지는 후술하겠다. ## Ruby로 One-liner 스크립트 작성하기 보통은 Ruby 코드를 작성할때 irb 같은 대화형 인터페이스를 사용하는 것이 일반적이지만, Bash 스크립트와 섞어서 사용할때는 one-liner 스크립트를 작성하는 것으로 시작한다. 여기서 one-liner 스크립트란 한줄짜리로 실행하는 스크립트라고 이해하면 된다. ruby one-liner 스크립트로 작성할때는 다음과 같이 시작한다. $ ruby -e "<expression>" 여기서 `-e` 옵션은 one-liner 스크립트의 필수요소인데, 파라미터로 넘겨준 한줄짜리 Ruby 코드를 evaluation해주는 역할을 한다. 여러분이 **파이프** 혹은 리다이렉션에 대한 개념을 이해하고 있다면, 이런 트릭도 사용할 수 있다. $ echo "5" | ruby -e "gets.to_i.times |t| \{ puts 'hello world' \}" # => # hello world # hello world # hello world # hello world # hello world 여러분이 표준라이브러리를 사용하고 싶을때는 `-r` 옵션을 사용할 수도 있다. 이 옵션은 ruby에서 `require`를 의미하는데, 식을 평가하기전에 `require`문을 미리 선언하고 들어가는 것이라 이해하면 된다. 예를 들면, 이런 것도 가능하다. $ echo "9" | ruby -rmath -e "puts Math.sqrt(gets.to_i)" # => 3.0 위의 스크립트는 아래와 동일하다. $ echo "9" | ruby -e "require 'math'; puts Math.sqrt(gets.to_i)" # => 3.0 이런 원리를 이용하면, JSON/XML/CSV/YAML 등의 포맷으로 출력되는 데이터를 어렵지 않게 처리할 수 있다. ## 다른 CLI 도구와 조합해서 사용해보기 > 이 글에서는 여러분이 표준 입출력, 리다이렉션, 그리고 유닉스 기본 명령어(e.g. echo/tail/tead/more/grep 등)는 이미 숙지를 하고 있으리라 생각한다. 이에 대해서 다루자면, 전하고자 하는 의도에 비해 글이 엄청 길어질 수 있어서 의도적으로 생략했다. 혹시나 당장은 모르더라도 상관없다. 그렇게 어렵지 않으니 실습을 한번쯤은 해보는 것을 권장한다. 위에서 예시를 든 것 가지고는 어떻게 하면 나한테 유용한 도구를 만들 수 있는지 파악하기 어려울 수 있다. 그렇다면, 실제로 우리가 사용하고 있는 CLI 도구를 같이 결합해보는건 어떨까? 친숙한 사례를 예시로 들자면 aws-cli, git, gh, jq, curl 등의 커맨드라인 도구가 있을 수 있겠다. 각각은 단일 작업에 특화되어 있어 그 자체로도 훌륭하지만, Ruby 스크립트와 결합했을 때 더욱 강력한 도구로 탈바꿈할 수 있다. 아래에서는 몇 가지 활용 사례와 그로 인해서 어떻게 시너지 효과를 일으킬 수 있는지 살펴보자. 먼저, 간단한 예시를 살펴보자. ### JSON 데이터 처리하기 JSON 포맷은 어떻게 보면 굉장히 범용적으로 사용되는 포맷이다. API 요청 날릴 때 쓰이는 것은 물론이고, 설정 파일에 쓰이기도 하고, 다른 인터페이스 간 데이터를 교환할 때도 많이 쓰이기도 한다. Ruby에서는 JSON 라이브러리를 표준 라이브러리로 포함하고 있기 때문에, 이것을 굉장히 유용하게 활용할 수 있다. $ curl -s https://jsonplaceholder.typicode.com/posts/1 | ruby -rjson -e 'data = JSON.parse(STDIN.read); puts "Title: #{data["title"]}"' 동작하는 방식은 간단하다. 1. curl로 요청을 날려서 JSON 응답을 반환받는다. 2. JSON 데이터를 파싱하고, 그 중에서 title 필드를 추출한다 3. 출력한다. 외부 API에 요청을 날리고 거기서 받은 JSON 응답을 처리하고자 할 때 굉장히 편리하게 처리할 수 있다. 단순히 뽑아내기만 할 때는 `jq`를 사용하는 것도 방법이긴 하지만, Ruby 스크립트 안에서는 더욱 다양하게 활용할 수 있다. 또한, **GitHub CLI** /**Flutter** /**AWS CLI** 등등이 `--format json` 같은 옵션을 지원하는데, 한번 섞어서 사용해보는 것을 권장한다. ### YAML 데이터 처리하기 YAML 포맷은 일반적으로는 설정 파일에 널리 사용된다. Ruby는 기본적으로 yaml 라이브러리를 포함하고 있으므로 YAML 파일을 읽고, 필요한 정보만 출력하는 작업을 쉽게 수행할 수 있다. 예를 들어, config.yaml 파일에서 특정 설정 값을 추출하는 스크립트는 다음과 같다. $ cat config.yaml | ruby -ryaml -e 'config = YAML.load(STDIN.read); puts "Server port: #{config["server"]["port"]}"' 이것도 역시 동작방식은 간단하다. 1. cat 명령어로 config.yaml 파일의 내용을 읽어오고, 2. Ruby의 YAML.load를 사용해 파싱한 후, 3. 서버 설정에서 포트 번호를 출력한다. 이와 같이 YAML 파일을 손쉽게 읽어서 원하는 부분만 추출하거나, 구조화된 데이터를 다른 CLI 도구와 연계하여 활용할 수 있다. 이도 역시 `--format yaml` 같은 옵션을 지원하는 `kubectl` 같은 CLI 도구와 함께 유용하게 사용될 수 있다. ### 정형화되어 있지 않은 복잡한 텍스트 데이터를 처리하기 모든 데이터가 JSON/CSV/YAML 포맷처럼 정형화되어 있으리라는 보장이 없다. 많은 경우 로그 파일, 시스템 메시지, 사용자 입력 등은 형식이 일정하지 않은 경우가 많다. 이런 경우에도 Ruby의 강력한 정규표현식 기능이나 텍스트 처리 능력을 활용하면 데이터를 원하는 형태로 추출하거나 가공할 수 있다. 대부분의 경우에는 높은 확률로 한줄한줄 읽어서 처리하면 되는 경우가 많다. 이번엔, 간단하면서 친숙한 `git log`를 예시로 살펴보자. 이번에는 글의 주제(one-liner)에서 다소 벗어났지만, 이런 식의 활용도 가능하다는걸 밝히고 싶다. 다음에서 설명하는 스크립트는 내가 굉장히 애용하는 스크립트 중 하나이다. Git 로그 중에서 원하는 커밋을 선택하고, 해당 커밋의 변경사항을 보여준 후, 조회한 내역을 체크리스트 형태로 출력한다. git_logs = `git log --oneline #{file} | gum choose --limit 100` git_logs.each_line do |line| commit_hash, *_ = line.split system("git show #{commit_hash}") puts("=====") puts("Press ENTER key to CONTINUE") puts("=====") gets end checklist = [] git_logs.each_line do |line| checklist << "- [ ] #{line}" end puts checklist.join 이번엔 조금 복잡할 수 있다. 그래도 인내심을 가지고 보면 그렇게 어렵진 않다. 1. Git 로그 추출: * `git log --oneline #{file}` 명령을 실행하여 한 줄에 하나의 커밋 정보를 출력한다. * `gum choose --limit 100`을 사용해, 출력된 로그 중 조회하고 싶은 라인을 인터랙티브하게 선택할 수 있다. * 선택된 결과는 `git_logs` 변수에 저장된다. 2. 각 커밋별 상세 조회: * `git_logs.each_line`을 통해 선택된 로그를 한 줄씩 순회한다. * 각 줄은 `<commit hash> <commit message>` 형식을 갖고 있으므로, `split` 메서드를 사용해 첫 번째 토큰(커밋 해시)만 추출한다. * 추출한 커밋 해시를 이용해 `git show #{commit_hash}` 명령을 실행, 해당 커밋의 변경 내용을 출력한다. * 각 커밋 조회 후, 사용자에게 "계속 진행하려면 ENTER 키를 누르라"는 메시지를 띄워 한 단계씩 진행할 수 있도록 한다. 3. 체크리스트 생성: * 다시 한 번 git_logs의 각 라인을 순회하며, 각 커밋 로그 앞에 체크리스트 형식(- [ ])을 붙여 리스트 항목을 만든다. * 모든 항목을 조합해 최종 체크리스트를 출력한다. ## 마치며 우리는 CLI 도구들과 Ruby 스크립트를 비롯한 다양한 스크립팅 언어를 활용해, 간단한 커맨드 조합만으로도 나만의 비밀무기를 만들 수 있는 방법들을 살펴보았다. 이러한 접근법을 통해 각 도구가 가진 단일 기능의 강점을 그대로 유지하면서, 이를 결합해 더욱 강력하고 유연한 자동화 워크플로우를 구성할 수 있음을 확인했다. 작은 한 줄의 스크립트가 복잡한 데이터 처리, 로그 분석, 버전 관리 작업을 손쉽게 해결해줄 뿐만 아니라, 실제 업무 현장에서 생산성을 극대화할 수 있는 발판이 된다. 여러분도 이번 기회를 계기로 다양한 CLI 도구와 스크립트를 조합하여, 나만의 맞춤형 자동화 도구를 만들어 보는 것은 어떨까? 이 글을 작성하기까지 적지 않은 영향을 주셨던 @ssiumha님께 감사를 표한다. * * * 그 외에도, Perl도 익혀두면 도움이 될 수 있다. Perl은 Git(libgit)이 설치되어 있다면 원플러스원으로 같이 설치되기 때문이다. 요즘은 Perl One-Liners Guide 같은 훌륭한 교재도 있고, LLM도 perl로 one liner 스크립트를 짜달라고 물어보면 뚝딱뚝딱하고 잘 짜주는 편이다.
0 0 0 0
Screenshot of iMovie’s “File” menu on macOS with the “New App Preview” option highlighted, showing how to start an App Store Product Page Preview project.

Screenshot of iMovie’s “File” menu on macOS with the “New App Preview” option highlighted, showing how to start an App Store Product Page Preview project.

Screenshot of iMovie’s project context menu with “Share Project” selected and a submenu showing export options including Email, Social Platforms, File, and App Preview.

Screenshot of iMovie’s project context menu with “Share Project” selected and a submenu showing export options including Email, Social Platforms, File, and App Preview.

Screenshot of iMovie’s App Preview export screen titled “Glu Sight AppStore Preview,” showing a sample video preview with resolution 886x1920, format details (MPEG-4, H.264 Video, AAC Audio), estimated size (46.3 MB), and a call-to-action button labeled “Next.”

Screenshot of iMovie’s App Preview export screen titled “Glu Sight AppStore Preview,” showing a sample video preview with resolution 886x1920, format details (MPEG-4, H.264 Video, AAC Audio), estimated size (46.3 MB), and a call-to-action button labeled “Next.”

Did you know you can create App Store product page previews right in iMovie? 🎬

Just go to File → New App Preview, edit your clips and export directly in the right format requested by Apple. Super handy for showcasing your app and improving #ASO.

#iOSDev #BuildInPublic #IndieDev #MobileDev #DevTip

4 2 2 0

Anyway that’s my #devTip for the day.
Writing solid & performant #code still beats AI generated stuff at this point in time. Also, it’s fun to build something yourself.

Might look into #caching solutions tonight, but that may be over engineering an MVP. 😹😹😹
#techSky #devSky

0 0 0 0

I am convinced we are living in the exact same space time! I have been giving this same feedback for years.

Another #devtip

Before asking for help, create a failing test that reproduces the problem. It shows you understand the problem, it's reproducible, and helps iterate to a solution faster.

2 0 0 0

A great #devtip for being respectful and mindful about your colleagues time is to first create WIP/Draft PR and ensure CI succeds before you say it's ready/published for review.
Just takes a few extra seconds to you, saves minutes and unnecessary context switching for peers.

15 2 2 0

💡💻 You can run `go version -m <path-to-go-binary> | head -1` to see which version of Go was used to build that binary.

#DevTip #golang

1 0 1 0
Video

Have a problem? Just pretend it wasn't there! #devtip #gamedev #indiedev #indiegamedev #indiegame

8 2 1 0

Pro #devTip

In your #build files, where you manage your #imports, comment the date you did so plus the URL of how you know the latest #version numbers

You’ll thank me years from now…

1 0 0 0
Handling Large Images in the Browser: How Canvas Saved the Day :: Tom J. A client uploaded 28 images, each around 5800 x 9500 pixels and 28 MB in size. When attempting to display these images in the browser, the entire tab froze - even refusing to close - for a solid 10 mi...

Super-Simple code for replacing <img> with <canvas> for large images boosted browser performance (from freezing to OK), handling massive files smoothly in our admin UI.

#webdev #programming #javascript #frontend #coding #weboptimization #html #devtip #performance

tomj.pro/handling-lar...

2 0 0 0

F1: Crea una nueva función para <<F2>>
F2: reutilizar <<F3>> dividirlo.
F3: código, _Nunca_ para
#devtip

0 0 0 0