Skip to content

Instantly share code, notes, and snippets.

View oliuz's full-sized avatar
💻
Coding!

Jose Rosado oliuz

💻
Coding!
View GitHub Profile
@dgilperez
dgilperez / gist:cd04989dd9d54f13a89e
Last active March 1, 2021 18:15
Sacando un trabajo a medias a una rama

Sacando código a otra rama

"Ocultas" los cambios en la pila de cambios local

git stash

Creas una rama local (no en github)

@sohelamin
sohelamin / laravel-related-posts.php
Created December 3, 2015 11:31
Related posts in Laravel
@JeffreyWay
JeffreyWay / ex.blade.php
Created November 5, 2016 19:22
Blade Directive for SVG Icon.
<!-- Before -->
<svg class="icon is-active" xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16">
<path d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"/>
</svg>
<!-- After -->
@icon ('flame', 'is-success')
@azimidev
azimidev / calculate_profile_percentage.php
Last active July 11, 2022 01:51
Calculates how much percentage of a profile is completed. It stripes off timestamps like created_at updated_at and primary keys like ids. Usually beneficial when using Laravel
<?php
/**
* Calculate how much a profile is completed
*
* @param $profile
* @return float|int
*/
function calculate_profile($profile)
{
if ( ! $profile) {
@leymannx
leymannx / iterm2-oh-my-fish.md
Last active May 5, 2024 13:53
iTerm2 Solarized Dark theme + Fish shell + oh-my-fish /// macOS High Sierra
@calebporzio
calebporzio / HiddenInput.vue
Created May 2, 2018 14:47
Little Vue component for turning JSON into native HTML for inputs
<script>
import _ from 'lodash'
export default {
props: [ 'name', 'value' ],
methods: {
flatInputsFromDeepJson(item, key, h) {
if (typeof item === 'object') {
return _.flatMapDeep(item, (value, newKey) => {
@calebporzio
calebporzio / ddValidation.php
Created June 20, 2018 16:30
little Laravel TestCase helper to get better validation output
<?php
// Place this method somewhere in TestCase.php
protected function ddValidation(array $except = [])
{
if ($this->originalExceptionHandler == null) {
$this->originalExceptionHandler = app(ExceptionHandler::class);
}
@calebporzio
calebporzio / HasUuid.php
Created July 5, 2018 17:36
A little trait to add to models that will have Uuids
<?php
// Example usage in a model:
class ExampleModel extends Model
{
use HasUuid;
protected $primaryKey = 'uuid';
<?php
Blade::directive('route', function ($expression) {
return '<?php route(' . $expression . '); ?>';
});
@mspclaims
mspclaims / AutoComplete.js
Created August 26, 2018 15:47
Floating label issue
/* eslint-disable react/prop-types */
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Select from 'react-select';
import { withStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import NoSsr from '@material-ui/core/NoSsr';
import TextField from '@material-ui/core/TextField';