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 | |
$servername = "localhost"; | |
$username = "root"; | |
$password = "secret"; | |
$dbname = "myDB"; | |
// Create connection | |
$conn = new mysqli($servername, $username, $password, $dbname); | |
// Check connection |
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; | |
use Illuminate\Support\Facades\DB; | |
class CostumSql { | |
protected $_table; | |
public function __construct($table_name){ |
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
<audio id="notif_audio"> | |
<source src="<?php echo base_url('sounds/notify.ogg');?>" type="audio/ogg"> | |
<source src="<?php echo base_url('sounds/notify.mp3');?>" type="audio/mpeg"> | |
<source src="<?php echo base_url('sounds/notify.wav');?>" type="audio/wav"> | |
</audio> | |
<button type="button" class="btn-play"> | |
Play ! | |
</button> |
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 $number =1; ?> | |
@foreach($links as $key => $value) | |
@if($number % 4 == 1 ) | |
[ | |
@endif | |
<h1>{{ $number.'-' }}</h1> | |
@if($number % 4 == 0 && $number > 0) | |
] | |
@endif | |
<?php $number++; ?> |
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 | |
$route = Route::getCurrentRoute(); | |
$route->prefix; //ex: api/ | |
$route->action['as']; //ex : api.items.index |
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
$("input[name='birthdate']:first").keyup(function(e){ | |
var key=String.fromCharCode(e.keyCode); | |
if(!(key>=0&&key<=9))$(this).val($(this).val().substr(0,$(this).val().length-1)); | |
var value=$(this).val(); | |
if(value.length==2||value.length==5)$(this).val($(this).val()+'/'); | |
}); |
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 | |
$str = 'This is S3F8G m7j34m h98H40D-3D39 90843-432423 LSDF3 4X4it very good 343c3.';; | |
preg_match_all("/(^[\D]+\s|\s[\D]+\s|\s[\D]+$|^[\D]+$)+/",$str,$result); | |
$result = implode('',$result[0]); | |
echo $result; |
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
$(document).ready(function(){ | |
$("#formattedNumberField").on('keyup', function(evt){ | |
if (evt.which != 110 ){//not a fullstop | |
var n = parseFloat($(this).val().replace(/\,/g,''),10); | |
$(this).val(n.toLocaleString()); | |
} | |
}); | |
}); |
OlderNewer