Skip to content

Instantly share code, notes, and snippets.

@nicolasbinet
nicolasbinet / scroll.distance.js
Created February 14, 2020 15:48
get scroll distance, when scrolling has stopped
var scrollDistance = function (callback, refresh) {
// Make sure a valid callback was provided
if (!callback || typeof callback !== 'function') return;
// Variables
var isScrolling, start, end, distance;
// Listen for scroll events
window.addEventListener('scroll', function (event) {
https://streamacon.com/video/laracon-us/taylor-otwell-laravel-53-overview
https://streamacon.com/video/laracon-us/adam-wathan-test-driven-laravel
https://streamacon.com/video/laracon-us/chris-fidao-servers-for-hackers
https://streamacon.com/video/laracon-us/evan-you-vuejs-workshop
https://streamacon.com/video/laracon-us/evan-you-vue-router-and-vuex
https://streamacon.com/video/laracon-us/jack-mcdade-wizards-lawnmowers-and-hovercrafts
https://streamacon.com/video/laracon-us/sentry-product-demo
https://streamacon.com/video/laracon-us/ben-ramsey-long-live-http2
https://streamacon.com/video/laracon-us/zeev-suraski-php-7
https://streamacon.com/video/laracon-us/amanda-folson-apis-with-lumen
$("#myModal").on('hidden.bs.modal', function (e) {
$("#myModal iframe").attr("src", $("#myModal iframe").attr("src"));
});
"repositories": [
{
"type": "vcs",
"url": "https://github.com/nicolasbinet/Instagram-PHP-API.git"
}
],
"require": {
"cosenary/instagram": "dev-patch-getUserMedia as 2.3",
"vinkla/instagram": "^3.1"
}
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
class DashboardSerieRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
@nicolasbinet
nicolasbinet / gist:e0db04b92056dc7525d0
Last active November 2, 2015 11:14
Laravel validation
@if ($errors->any())
<p class="alert alert-danger">{{ trans('validation.form_not_valid') }}</p>
@endif
<div class="panel panel-default">
<div class="panel-heading">Référencement</div>
<div class="panel-body">
<div class="form-group @if ($errors->has('seo[title]')) has-error has-feedback @endif">
{!! Form::label('seo[title]', 'Titre', ['class' => 'control-label']) !!}
{!! Form::text('seo[title]', null, ['class' => 'form-control']) !!}
@nicolasbinet
nicolasbinet / routes.php
Created September 2, 2015 12:16
routes name problem
Route::group(['prefix' => 'dashboard', 'as' => 'dashboard.', 'middleware' => 'auth'], function () {
Route::get('/', ['as' => 'home', 'uses' => 'Dashboard\DashboardController@home']);
Route::resource('news', 'Dashboard\NewsController', ['as' => 'news']);
});
@while $i > 0 {
.item-#{$i} {
top: ((100 - $i) * 0.4vh);
height: percentage($i/100);
}
$i: $i - 5;
}
angular.module('granon',[
'ui.router',
'ngResource',
'granon.activities.controllers',
'granon.activities.services'
]);
angular.module('granon').config(function($stateProvider, $httpProvider){
$stateProvider
.state('app',{
// grab the initial top offset of the navigation
var $sticky_navigation = $('#site-nav');
var sticky_navigation_offset_top = 102;
// our function that decides weather the navigation bar should have "fixed" css position or not.
var sticky_navigation = function(){
var scroll_top = $(window).scrollTop(); // our current vertical position from the top
// if we've scrolled more than the navigation, change its position to fixed to stick to top, otherwise change it back to relative
if ($(window).width() > 600) {