Skip to content

Instantly share code, notes, and snippets.

View Naoray's full-sized avatar
🚀
Exploring new ways

Krishan König Naoray

🚀
Exploring new ways
View GitHub Profile
var time = '';
var hour = 0;
var min = 0;
var sec = 0;
$.each($('.Lesson-List__length'), function(i, el) {
min += parseInt($(el).text().split(':')[0]);
sec += parseInt($(el).text().split(':')[1]);
if(sec >= 60) {
min += parseInt(sec/60);
sec %= 60;
@Naoray
Naoray / Entity.cs
Created October 5, 2017 11:26
Entity
class Entity
{
protected Texture2D _texture;
public Vector2 Position;
protected Vector2 _velocity;
public Vector2 Velocity { get { return _velocity; } }
<!-- Phone -->
<div class="form-group" :class="{'has-error': form.errors.has('phone')}">
<label class="col-md-4 control-label">Phone</label>
<div class="col-md-6">
<input type="phone" class="form-control" name="phone" v-model="form.phone">
<span class="help-block" v-show="form.errors.has('phone')">
@{{ form.errors.get('phone') }}
</span>
var base = require('settings/profile/update-contact-information');
Vue.component('spark-update-contact-information', {
mixins: [base],
/**
* The component's data.
*/
data() {
return {
<?php
class SparkServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
<?php
class ContactInformationController extends Controller
{
//...
/**
* Update the user's contact information settings.
*
* @param Request $request
<?php
class UpdateContactInformation implements Contract
{
/**
* {@inheritdoc}
*/
public function handle($user, array $data)
{
$user->forceFill([
<?php
class SparkServiceProvider
{
public function booted()
{
Spark::swap('UpdateContactInformatio@handle', function ($user, array $data) {
$user->forceFill([
'name' => $data['name'],
<?php
namespace App\SparkExtensions;
use Illuminate\Support\Facades\Validator;
use Laravel\Spark\Events\Profile\ContactInformationUpdated;
use Laravel\Spark\Interactions\Settings\Profile\UpdateContactInformation as SparkUpdateContactInformation;
class UpdateContactInformation extends SparkUpdateContactInformation
{
@Naoray
Naoray / Project.php
Created January 11, 2018 09:19
Accessor can't be accessed through HasMany Relationship
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Project extends Model
{
public function getFooAttribute()
{