Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@m5lil
m5lil / reset.sh
Last active April 23, 2024 13:12
[reset jetbrains application trial] reset jetbrains ide evals v1.0.4 #others
#!/bin/bash
# reset jetbrains ide evals v1.0.4
OS_NAME=$(uname -s)
JB_PRODUCTS="IntelliJIdea CLion PhpStorm GoLand PyCharm WebStorm Rider DataGrip RubyMine AppCode"
if [ "$OS_NAME" == "Darwin" ]; then
echo 'macOS:'
for PRD in $JB_PRODUCTS; do
@martinsam16
martinsam16 / docker-wsl2.md
Last active April 23, 2024 13:11
How to install wsl2 ubuntu + docker + docker-compose

Activate wsl2

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2

Install and Configure Ubuntu

@adamwdennis
adamwdennis / local-llama3-macos.txt
Created April 23, 2024 12:37
Running Llama3 locally...
# Make sure you have the following installed:
# 1. homebrew for MacOS
# 2. docker desktop for MacOS
# Run the following commands, in order:
brew install ollama;
ollama serve &;
ollama pull llama3;
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
@wojtekmaj
wojtekmaj / .gitignore
Last active April 23, 2024 13:08
How to upgrade Yarn to Yarn Modern (v4 at the moment) seamlessly
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
@flarn2006
flarn2006 / ScreenTint.cs
Created February 4, 2016 04:12
Screen tinting code for C#
// Created by flarn2006 <flarn2006@gmail.com>
// Licensed under MIT License
using System;
using System.Runtime.InteropServices;
namespace YourNamespaceHere //TODO: change me
{
static class ScreenTint
{
// Uncompressed version of
// https://gist.github.com/munificent/b1bcd969063da3e6c298be070a22b604
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#include <stdbool.h> // 2008-2019
const int HEIGHT = 40;
const int WIDTH = 80;
@zec4o
zec4o / postman-api-testing.md
Last active April 23, 2024 13:05
Testes Automatizados de API com Postman
@mike-lawrence
mike-lawrence / helper_functions.r
Last active April 23, 2024 13:03
Stan vs LME4 for hiearchical within-subjects designs with binomial outcomes
#' Installs any packages not already installed
#' @examples
#' \dontrun{
#' install_if_missing(c('tidyverse','github.com/stan-dev/cmdstanr'))
#' }
install_if_missing = function(pkgs){
missing_pkgs = NULL
for(this_pkg in pkgs){
@ZucchiniZe
ZucchiniZe / list-files-in-dir.clj
Created February 15, 2016 10:00
simple clojure function to recursively list files in directories.
(let [directory (clojure.java.io/file "/path/to/list")
dir? #(.isDirectory %)]
(map #(.getPath %)
(filter (comp not dir?)
(tree-seq dir? #(.listFiles %) directory))))
@luismts
luismts / GitCommitBestPractices.md
Last active April 23, 2024 13:02
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.