Skip to content

Instantly share code, notes, and snippets.

View angel-mora's full-sized avatar
🔥
Busy

Angel Mora angel-mora

🔥
Busy
  • Everywhere
View GitHub Profile
// Array Methods Challenge
// Create a function to filter users with id and age > 18
const data = [
{
name: 'John',
lastName: 'Doe',
age: 18,
},
@kieranklaassen
kieranklaassen / chat_gpt_service.rb
Created December 5, 2022 14:07
Unofficial ChatGPT API Wrapper Ruby
# The ChatGptService class provides an easy way to integrate with the OpenAI ChatGPT API.
# It allows you to send and receive messages in a conversation thread, and reset the thread
# if necessary.
#
# Example usage:
# chat_gpt_service = ChatGptService.new(BEARER_TOKEN)
# response = chat_gpt_service.chat("Hello, how are you?")
# puts response
# # => {"message"=>
# # {"id"=>"8e78691a-1fde-4bd5-ad68-46b23ea65d8f",
@bashbunni
bashbunni / .zshrc
Created October 27, 2022 21:41
CLI Pomodoro for Mac
# I'll be doing another one for Linux, but this one will give you
# a pop up notification and sound alert (using the built-in sounds for macOS)
# Requires https://github.com/caarlos0/timer to be installed
# Mac setup for pomo
alias work="timer 60m && terminal-notifier -message 'Pomodoro'\
-title 'Work Timer is up! Take a Break 😊'\
-appIcon '~/Pictures/pumpkin.png'\
-sound Crystal"
# I find myself using many of these gems frequently
# Lots of them require preliminary configuration work, which can be difficult to remember on the fly
# This gist should help me and anyone who uses similar gems to install them without wasting brain cycles
# I will update this gist as I come across more useful gems and their configuration instructions
# /Gemfile
gem 'custom_error_message' # (https://github.com/jeremydurham/custom-err-msg/) To write custom validation error messages
group :development, :test do
gem 'spring' # (https://github.com/rails/spring) Leverage Spring's preloading capabilities in the both the development and test environments. Don't forget to delete this gem in its default location ('group :development')
@rberaldo
rberaldo / obsidian-to-org.py
Last active February 21, 2025 12:18
Obsidian to org-roam migration kit – a completely half-baked attempt at moving from Obsidian to org-roam which nevertheless works (for me).
#!/usr/bin/python
import sys,re,os
if not os.path.isdir("out/"):
os.mkdir("out/")
md_file = sys.argv[1]
org_file = md_file[:-3] + ".org"
@ProGM
ProGM / arel_cheatsheet_on_steroids.md
Last active April 17, 2025 09:46
Arel cheatsheet on Steroids

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

@nickpeihl
nickpeihl / README.md
Last active December 22, 2024 12:51
GDAL and Elasticsearch examples

GDAL and Elasticsearch examples

Shapefile

GDAL Shapefile docs

Import shapefile into Elasticsearch

ogr2ogr -f ElasticSearch \
-lco NOT_ANALYZED_FIELDS={ALL} \
http://elastic:changeme@localhost:9200 \
@PashCracken
PashCracken / WSL-with-zsh-and-powerlevel9k.png
Last active September 4, 2023 07:28
WSL, zsh and Powerlevel10k
WSL-with-zsh-and-powerlevel9k.png

Prepare for SQL interview questions

Tutorial

SQL tutorial: https://tutorial.techaltum.com/SQLServer.html

Sample questions and solutions