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
# This will retrieve v8 7.4.288.25 when installled | |
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/0a6171330678879285f2c566db9349da421d6f62/Formula/v8.rb | |
brew install v8.rb | |
brew list v8 | |
# You will see this: | |
# /usr/local/Cellar/v8/7.4.288.25/bin/d8 | |
# /usr/local/Cellar/v8/7.4.288.25/libexec/include/ (21 files) | |
# /usr/local/Cellar/v8/7.4.288.25/libexec/ (7 files) |
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 | |
namespace App\Concerns; | |
use Money\Money; | |
use Money\Currency; | |
trait HasMoneyFields | |
{ | |
public function getAttributeValue($key) | |
{ |
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 | |
use Illuminate\Database\Seeder; | |
class CountryTableSeeder extends Seeder | |
{ | |
/** | |
* Run the database seeds. | |
* | |
* @return void |
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
/* | |
* Finds the ideal text color for legibility on the background color provided | |
* Example i/o: idealTextColor('#000000') -> #ffffff | |
*/ | |
function idealTextColor(background) { | |
var r = background.substring(1, 3); | |
var g = background.substring(3, 5); | |
var b = background.substring(5, 7); |
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
// creates valid slugs from strings. replaces turkish characters correctly. | |
function slugify(string) { | |
var letters = { "İ":"i", "I":"i", "ı":"i", "Ş":"s", "ş":"s", "Ğ":"g", "ğ":"g", "Ü":"u", "ü":"u", "Ö":"o", "ö":"o", "Ç":"c", "ç":"c" }; | |
string = string.replace(/[İIıŞşĞğÜüÇçÖö]/g, function(letter){ return letters[letter]; }) | |
.toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - |
NewerOlder