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
#!/bin/bash | |
branch_name=$(git symbolic-ref --short HEAD) # Get the current branch name | |
short_branch_name=$(echo "$branch_name" | cut -c 1-8) # Extract the first 8 characters | |
# If the commit message file doesn't exist or is empty, use the default commit message | |
if [ ! -s "$1" ]; then | |
echo "$short_branch_name: " > "$1" | |
else | |
# Append the branch name to the beginning of the commit message |
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 | |
// Inside boot method | |
Nova::serving(function () { | |
Nova::script('input-error-handler-js', public_path('custom/js/nova.js')); | |
Nova::style('input-error-handler-css', public_path('custom/css/nova.css')); | |
}); |
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
const axios = require('axios'); | |
const util = require('util'); | |
const crypto = require('crypto'); | |
const OAuth = require('oauth-1.0a'); | |
const options = [ | |
'coding', | |
'music', | |
'sherlock holmes', | |
'wisdom', |
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
String file contentssss |
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
String file contents |
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 component(name, url) { | |
let content = fs.readFileSync(url + '.vue', 'utf-8') | |
let element = document.createElement('body') | |
element.innerHTML = content | |
content = element.children[1].innerHTML.trim() | |
return Vue.component(name, { | |
template: element.children[0].innerHTML.trim(), | |
...eval('let module={};\n' + content) | |
}) | |
} |
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
Show how you can leverage Laravel Collections to create an elegant solution to the following problem. Create a function that accepts a GitHub username, and returns that users "Score" based on the below rules. The information can be retrieved using GitHub's public api (https://api.github.com/users/:username/events/public). Upload your answer to a private gist (https://gist.github.com/) and share the URL. | |
PushEvent = 10 points. | |
PullRequestEvent = 5 points. | |
IssueCommentEvent = 4 points. | |
Any other event = 1 point |
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 | |
namespace App\Traits; | |
use App\Meta; | |
trait HasMeta | |
{ | |
public function fromMeta($key) | |
{ | |
return optional($this->meta->where('key', $key)->first())->value; |