Skip to content

Instantly share code, notes, and snippets.

@sangeeths
sangeeths / github-to-bitbucket
Created March 10, 2014 15:24
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone git@bitbucket.org:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync git@github.com:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@CrankyBunny
CrankyBunny / startup.gd
Created March 3, 2023 06:03
Determine the instance number for Godot run multiple instances feature
var _instance_num := -1
var _instance_socket: TCPServer
func _init() -> void:
if OS.is_debug_build():
_instance_socket = TCPServer.new()
for n in range(0,4):
if _instance_socket.listen(5000 + n) == OK:
_instance_num = n
break
@ultrafunkamsterdam
ultrafunkamsterdam / fastapi_react.py
Last active April 24, 2024 22:47
FastAPI support for React ( with working react-router )
"""
███████╗ █████╗ ███████╗████████╗ █████╗ ██████╗ ██╗
██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██║
█████╗ ███████║███████╗ ██║ ███████║██████╔╝██║
██╔══╝ ██╔══██║╚════██║ ██║ ██╔══██║██╔═══╝ ██║
██║ ██║ ██║███████║ ██║ ██║ ██║██║ ██║
╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝
██████╗ ███████╗ █████╗ ██████╗████████╗
██╔══██╗ ██╔════╝ ██╔══██╗ ██╔════╝╚══██╔══╝
██████╔╝ █████╗ ███████║ ██║ ██║
import vertexai
from vertexai.generative_models import GenerativeModel, ChatSession
vertexai.init(project=project, location=location)
model = GenerativeModel("gemini-1.5-pro-preview-0409")
chat = model.start_chat()
def get_chat_response(chat: ChatSession, prompt: str) -> str:
text_response = []
responses = chat.send_message(prompt, stream=True)
@rouxcaesar
rouxcaesar / bradfield-thoughts.md
Last active April 24, 2024 22:38
Thoughts on Bradfield

My Thoughts on Bradfield

I've been asked by several people over time about my experience with the classes offered by Bradfield, and thought that I should save some future keystrokes by writing up a short gist for future reference. Hopefully this gist will be useful for others who are considering Bradfield and wondering it is worth it. My intended audience is primarily Launch School students who have completed the Core program and likely also Capstone, but the majority of this gist will be applicable to anyone who is a working/experienced software engineer.

Since late 2019, I've taken 4 short courses from the Bradfield School of Computer Science and in 2021 I enrolled in their Computer Science Intensive (CSI) program1. Overall, I've found the courses and CSI to be an excellent opportunity to grown my technical skills and broaden my knowledge of CS topics.

The courses I completed were:

  • Computer Architecture: The Hardware/Software Interface
@0xdevalias
0xdevalias / _deobfuscating-unminifying-obfuscated-web-app-code.md
Last active April 24, 2024 22:33
Some notes and tools for reverse engineering / deobfuscating / unminifying obfuscated web app code
@diego3g
diego3g / settings.json
Last active April 24, 2024 22:26
VSCode Settings (Updated)
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {
@arshednabeel
arshednabeel / vicsek.py
Last active April 24, 2024 22:25
A minimal implementation of the Vicsek model in ~50 lines of code
import numpy as np
from tqdm import trange
def get_neighbour_matrix(x, L, R):
dx = np.subtract.outer(x[:, 0], x[:, 0])
dy = np.subtract.outer(x[:, 1], x[:, 1])
dx[dx > (L / 2) ** 2] -= (L / 2) ** 2
dy[dy > (L / 2) ** 2] -= (L / 2) ** 2
pair_dist = dx ** 2 + dy ** 2
@xacrimon
xacrimon / backup.sh
Last active April 24, 2024 22:22
Backup script using tar and xz for arch linux
#!/bin/sh
if [[ $(whoami) != "root" ]]
then echo "Please run as root"
exit 1
fi
if [ "$(ls /bin | grep trizen)" == "trizen" ]
then
PKGMAN=trizen
else
@mcandre
mcandre / brew-list-orphaned-packages.sh
Created September 7, 2018 21:32
Homebrew list orphaned packages
#!/bin/bash
brew list | while read cask; do echo -ne "\x1B[1;34m $cask \x1B[0m"; brew uses $cask --installed | awk '{printf(" %s ", $0)}'; echo ""; done