#!/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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ask": 182.28, | |
"askSize": 11, | |
"averageDailyVolume10Day": 50579500, | |
"averageDailyVolume3Month": 54123437, | |
"bid": 182.32, | |
"bidSize": 9, | |
"bookValue": 4.793, | |
"currency": "USD", | |
"dividendDate": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"assetProfile": { | |
"address1": "One Apple Park Way", | |
"city": "Cupertino", | |
"state": "CA", | |
"zip": "95014", | |
"country": "United States", | |
"phone": "408 996 1010", | |
"website": "https:\/\/www.apple.com", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
enum Grade: string | |
{ | |
case PASS = 'pass'; | |
case FAIL = 'fail'; | |
case A = 'A'; | |
case F = 'F'; | |
case INVALID = 'Invalid grade!\n'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class courseGrade | |
{ | |
public function grade($currentGrade) | |
{ | |
if (!is_integer($currentGrade)) { | |
return "Invalid Data"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getWaterState($degrees) | |
{ | |
$stateMessage = 'This is liquid water'; | |
if ($degrees < 0) { | |
$stateMessage = 'This is solid ice'; | |
} | |
if ($degrees > 100) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getWaterState($degrees) | |
{ | |
if ($degrees < 0) { | |
return 'This is solid ice'; | |
} | |
if ($degrees > 100) { | |
return 'This is gaz water'; | |
} |
NewerOlder