-
All code goes inside of PHP tags:
<?php // code goes here ?>
-
Note, this is not an HTML tag; there is no closing tag to go along with it. Your PHP code will literally go between the
?
s
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
class Icu4cAT64 < Formula | |
desc "C/C++ and Java libraries for Unicode and globalization" | |
homepage "http://site.icu-project.org/home" | |
url "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-src.tgz" | |
version "64.2" | |
sha256 "627d5d8478e6d96fc8c90fed4851239079a561a6a8b9e48b0892f24e82d31d6c" | |
keg_only :versioned_formula | |
def install |
- Make a wave of boxes. (Similar to visible spectrum exercise, but comes back in and out).
- It should hold the lines of a poem. Any poem. Songs work too.
- Make it look nice. Matching color scheme (practice good design principles - no more than 5 colors per page.)
- The text should be centered inside the box using padding.
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
1. Find the name of all departments currently managed by women. | |
Department Name | Manager Name | |
----------------+----------------- | |
Development | Leon DasSarma | |
Finance | Isamu Legleitner | |
Human Resources | Karsetn Sigstam | |
Research | Hilary Kambil | |
2. Find the current titles of employees currently working in the Customer Service department. | |
Title | Count |
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
extendedPWD() { | |
pwd_length=25 | |
((pwd_length2=$pwd_length + 2)) | |
((pwd_length3=$pwd_length - 2)) | |
DIR=`pwd` | |
echo $DIR | grep "^$HOME" >> /dev/null | |
if [ $? -eq 0 ]; then | |
CURRDIR=`echo $DIR | awk -F$HOME '{print $2}'` |
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
"use strict"; | |
var Hangman = { | |
words: [], // Set of words for hangman to choose from | |
currentWord: '', // Current word for the game | |
correctGuesses: [], // Correct letters the user has guesses | |
incorrectGuesses: [], // Wrong letters the user has guessed | |
maxGuesses: 0, // Maximum number of wrong guesses the user is allowed | |
/** |
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 BaseModel { | |
const UNIT_KM = 111.045; | |
const UNIT_MI = 69.0; | |
// Throw this function in any model with latitude/longitude columns | |
// Or if multiple models have those values you can put it in your BaseModel | |
public function scopeNearLatLong($query, $lat, $lng, $radius = 10, $unit = 69.0) | |
{ |
When a PHP DateTime (or Carbon date) object is converted to JSON it is sent in a format that native JavaScript cannot parse, like this:
{
"date": "2015-09-10 14:09:46",
"timezone_type": 3,
"timezone": "UTC"
}
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 | |
// app/controllers/PostsController.php | |
class PostsController extends \BaseController | |
{ | |
// ... | |
public function destroy($id) | |
{ | |
// ... |
NewerOlder