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 translateToWords($number) | |
{ | |
/***** | |
* A recursive function to turn digits into words | |
* Numbers must be integers from -999,999,999,999 to 999,999,999,999 inclussive. | |
* | |
* (C) 2010 Peter Ajtai | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or |
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 in_array_r($needle, $haystack, $strict = false) { | |
// iterate over all items | |
foreach ($haystack as $key => $item) { | |
// check if the item is array, if so then call recursive function | |
if (is_array($item)){ | |
$ret = in_array_r($needle, $item, $strict); | |
if( is_array($ret) ) | |
return $ret; |
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
package.json{ | |
{ | |
"devDependencies": { | |
"gulp": "^3.8.8", | |
"laravel-elixir": "^6.0.0-15", | |
"laravel-elixir-vueify": "^1.0.0", | |
"laravel-elixir-webpack-official": "^1.0.10" | |
}, | |
"browser": { | |
"vue": "vue/dist/vue.common.js" |
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
"niklasravnsborg/laravel-pdf": "^1.5" | |
$response = view("print.letter", compact("products", "date", "attachment_files", "letter_number", "content"))->render(); | |
$pdf = new Pdf($response, | |
['format' => 'A4','custom_font_path' => base_path('public'), // don't forget the trailing slash! | |
'custom_font_data' => [ | |
'IRANSans' => [ | |
'R' => 'IRANSans-Bold-web.ttf', // regular font | |
'B' => 'IRANSans-Bold-web.ttf', // optional: bold font | |
'I' => 'IRANSans-Bold-web.ttf', // optional: italic font |
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 | |
use App\Acme\Box; | |
use App\Cases; | |
use App\Complaint; | |
use App\User; | |
use App\UserMeta; | |
use Illuminate\Foundation\Testing\WithoutMiddleware; | |
use Illuminate\Foundation\Testing\DatabaseMigrations; | |
use Illuminate\Foundation\Testing\DatabaseTransactions; |
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 getSearchResult($keyword){ | |
$subject = file_get_contents("http://www.google.com/search?q=".urlencode($keyword)); | |
$href_pattern = '/<h3 class="r">(.*?)<\/h3>/s'; | |
preg_match_all($href_pattern, $subject, $matches); | |
foreach ($matches[0] as $key => $match) { | |
$replacment_pattern = '/href="([^"]+)"/'; |
NewerOlder