This file contains hidden or 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
{ | |
"repositories": [ | |
{ | |
"type": "git", | |
"url": "https://github.com/pressbooks/new-private-project" | |
} | |
], | |
"require": { | |
"pressbooks/new-private-project": "dev-bugfixes" | |
} |
This file contains hidden or 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 AstronautController{ | |
private string $name; | |
private float $pounds; | |
function __construct(string $name, float $pounds){ | |
$this->setName($name); |
This file contains hidden or 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 | |
/* | |
must return TRUE: | |
('arc', 'car') | |
('listen', 'silent') | |
('malarm', 'malmar') | |
('peer', 'eper') | |
must return FALSE: |
This file contains hidden or 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
$(document).ready(() => { | |
$(".onlyNumbers").keypress(function (e) { | |
if (e.which !== 8 && e.which !== 0 && (e.which < 48 || e.which > 57)) { | |
return false; | |
} | |
}); | |
}); |
This file contains hidden or 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
new Promise<XMLHttpRequest>((resolve, reject) => { | |
xhr.onreadystatechange = ()=> resolve(xhr); | |
}) | |
.then(result => { | |
(result.status == 200) ? statusMessage(messageSuccess) : statusMessage(messageError); | |
}) | |
.catch(error => console.log('ERROR:', error.message)); |
This file contains hidden or 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
const handleResumeForm = (inputTargetId)=>{ | |
const RESUME_INPUT = document.getElementById(inputTargetId); | |
const RESUME_FILE_NAME = RESUME_INPUT.value; | |
const ALLOWED_EXTENSIONS = ['pdf','doc','docx']; | |
const ERROR_CLASS = 'form-error'; | |
const inArray = (array, key)=>{ | |
let result = false; | |
array.forEach((item)=>{ item === key ? result = true : '' }) | |
return result; |
This file contains hidden or 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
find . -name "*.[extension]" | xargs wc -l | tail -1 |
This file contains hidden or 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
local inspect = require('inspect') | |
local table = { a='a', b='b', c='c'} | |
print(inspect(table)) |
This file contains hidden or 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
#!/bin/bash | |
printf "[BACKUP PROJECTS]\n\n" | |
temp_dir=$(mktemp -d) | |
package_name=backup_package | |
mkdir ~/$package_name | |
printf "COPYING TO TEMP DIR...\n\n" |
This file contains hidden or 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 math | |
from PIL import Image, ImageChops | |
class AdjustImages: | |
@staticmethod | |
def get_next_height(height): | |
fullhd_height = 1080 | |
if height % fullhd_height == 0: |