Skip to content

Instantly share code, notes, and snippets.

View elminson's full-sized avatar

Elminson De Oleo Baez elminson

View GitHub Profile
{
"ask": 182.28,
"askSize": 11,
"averageDailyVolume10Day": 50579500,
"averageDailyVolume3Month": 54123437,
"bid": 182.32,
"bidSize": 9,
"bookValue": 4.793,
"currency": "USD",
"dividendDate": {
[
{
"assetProfile": {
"address1": "One Apple Park Way",
"city": "Cupertino",
"state": "CA",
"zip": "95014",
"country": "United States",
"phone": "408 996 1010",
"website": "https:\/\/www.apple.com",

Step 1

create hooks/pre-commit file with this content

#!/bin/bash

# Get the current branch name
current_branch=$(git rev-parse --abbrev-ref HEAD)

# Skip execution if the branch is 'beta' or 'dev'
if [[ $current_branch == "master" ]] || [[ $current_branch == "beta" ]] || [[ $current_branch == "dev" ]]; then
<?php
enum Grade: string
{
case PASS = 'pass';
case FAIL = 'fail';
case A = 'A';
case F = 'F';
case INVALID = 'Invalid grade!\n';
import os
import requests
# Update a File if is older than X minutes
def update_old_file(remote_url, local_file, max_expiration_time = 10):
st = os.stat(dir_path + save_as_file)
mtime = st.st_mtime
file_age = (time.time() - mtime) / 60
@elminson
elminson / mamp.md
Created September 26, 2021 05:34 — forked from jfloff/mamp.md
How to get MAMP to work with SSL ... Yes really.

First of all you need to be able to run MAMP in port 80. This is a "heat check" if you don't have any process jamming http ports. You can check it like this:

sudo lsof | grep LISTEN

If you do happen to have any process with something like this *:http (LISTEN), you are in trouble. Before with adventure check if it isn't MAMP itself (yeah, you should close that beforehand)

ps <pid of that process>

If you don't see MAMP, you are in good hands, I have just the thing for you:

@elminson
elminson / MY_Session.php
Created October 1, 2020 15:39 — forked from ikawka/MY_Session.php
Use redis in Codeigniter Session.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Session extends CI_Session{
private $sess_use_redis = TRUE;
private $redis = '';
public function __construct($params = array()) {
//parent::__construct();
$this->CI =& get_instance();
<?php
class courseGrade
{
public function grade($currentGrade)
{
if (!is_integer($currentGrade)) {
return "Invalid Data";
function getWaterState($degrees)
{
$stateMessage = 'This is liquid water';
if ($degrees < 0) {
$stateMessage = 'This is solid ice';
}
if ($degrees > 100) {
function getWaterState($degrees)
{
if ($degrees < 0) {
return 'This is solid ice';
}
if ($degrees > 100) {
return 'This is gaz water';
}