Skip to content

Instantly share code, notes, and snippets.

View axeldeveloper's full-sized avatar
🏠
Working from home

Axel Alexander axeldeveloper

🏠
Working from home
View GitHub Profile
# This should be triggered through a cron job at 6:15 PM on week days.
# Example cron: 15 18 * * 1,2,3,4,5 cd ~/code/jury_duty && ~/.rbenv/shims/ruby call.rb >> ~/code/jury_duty/call-log.txt 2>&1
# It uses Twilio to make a call based on TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, and TWILIO_PHONE.
# It calls the JURY_PHONE, transcribes it, looks for JURER_NUMBER and texts the result to PERSONAL_PHONE.
require "rubygems"
require "bundler/setup"
Bundler.require(:default)
Dotenv.load
@noxsite
noxsite / Dockefile
Last active September 8, 2022 18:18
PHP8.1 and sqlite3 for Laravel9 Development at Single Docker Container [comments pt-BR]
FROM alpine:3.16
#lista apk necessarias. Obs.: a extensao PCRE no php8.1 vem junto do core.
RUN mkdir /app
WORKDIR /app
RUN apk add vim curl openssl sqlite php81 php81-openssl php81-intl php81-openssl php81-sqlite3 php81-pear php81-tokenizer php81-phpdbg php81-pdo_mysql php81-common php81-xsl php81 php81-fpm php81-mysqlnd php81-snmp php81-doc php81-fileinfo php81-mbstring php81-embed php81-xmlreader php81-pdo_sqlite php81-exif php81-session php81-gd php81-json php81-xml php81-iconv php81-curl php81-phar php81-imap php81-pdo_dblib php81-pgsql php81-zip php81-ctype php81-bcmath php81-calendar php81-dom php81-sockets php81-soap php81-pdo php81-bz2 php81-mysqli php81-simplexml php81-xmlwriter
RUN ln -s /usr/bin/php81 /usr/bin/php
#instalando composer... entre no site e confirme se esta na versao mais recente
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a
@rodloboz
rodloboz / app.rb
Created August 14, 2020 08:01
SQL CRUD
# Gem/Library to allow Ruby to interact with the DB
require 'sqlite3'
require 'byebug'
require_relative 'doctor'
# Create a DB connection
DB = SQLite3::Database.new("doctors.db")
#[[1, "John Smith", 39, "Anesthesiologist"], [2, "Emma Reale", 31, "Cardiologist"]]
@nasrulhazim
nasrulhazim / install-php-mssql-drivers-in-macos-mojave.md
Last active June 10, 2025 22:07
Install PHP MSSQL Driver in MacOS (Mojave)

Installing Brew

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Installing MSSQL Tools

brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release

https://github.com/reireias/dotseeker

grep -r -E -v -h '^\s*#' files | grep --color=none -E "^\s*alias " | sed -e 's/#.*//g' -e 's/^\s*//g' -e 's/\s*$//g' | sort | uniq -c | sort -nr
 90 alias ls='ls --color=auto'
 87 alias grep='grep --color=auto'
 59 alias fgrep='fgrep --color=auto'

59 alias egrep='egrep --color=auto'

@ernestkamara
ernestkamara / AdbCommands
Created June 26, 2018 08:42 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
"github.com/jinzhu/gorm"
@kendrahavens
kendrahavens / DockerDebugVSCode.md
Last active March 1, 2024 20:31
Debug a .NET Core Project in a Docker container with VS Code

title: Debug a .NET Core Project in a Docker container with VS Code description: Debug a .NET Core Project in a Docker container with VS Code keywords: .NET, .NET Core, Docker, Debug, debugging, vs code, visual studio code, dotnet, core ms.author: kendrahavens ms.date: 02/15/17 ms.topic: article ms.prod: .net-core ms.assetid: b9c42367-72e7-4947-b7e2-316a240fbb39

@mankind
mankind / rails-jsonb-queries
Last active October 8, 2025 23:13
Ruby on Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
@hadees
hadees / arel_helpers.rb
Created March 5, 2016 05:41
Arel Helpers
module ArelHelpers
extend self
def self.included(base)
base.extend self
end
def asterisk(arel_table_or_model)
arel_table, columns = case arel_table_or_model
when Arel::Table