Skip to content

Instantly share code, notes, and snippets.

@danielme85
danielme85 / danScramble.js
Created March 2, 2017 15:16
Simple scramble char effect jQuery plugin
(function($) {
$.fn.danScramble = function(options) {
var $this = $(this);
var opts = $.extend({}, $.fn.danScramble.defaults, options);
var letters = opts.letters.split('');
var maxTries = opts.maxTotalTries;
var randomMax = opts.randomMax;
var length = letters.length;
var string = $this.text();
var array = string.split('');
@danielme85
danielme85 / Weather.php
Last active August 1, 2022 16:34
Pulls weather data from openweathermap using Laravel 5.* framework, based on cords from GeoIP2: https://github.com/danielme85/laravel-geoip2
<?php
namespace App\Addons;
use GuzzleHttp;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Log;
class Weather
{
@danielme85
danielme85 / danWeather.js
Last active August 1, 2022 16:34
Pulls weather data trough ajax and renders bootstrap html. PHP Laravel back-end code: https://gist.github.com/danielme85/8ddd04431ea2d6982e0b14802464ea0a
/**
* Created by mellum on 8/3/2016.
* Gets data from Laravel back-end: https://gist.github.com/danielme85/8ddd04431ea2d6982e0b14802464ea0a
* Based on GeoIP2 https://github.com/danielme85/laravel-geoip2
* This product includes GeoLite2 data created by MaxMind, available from: http://www.maxmind.com
* Beautiful css weather icons by Erik Flowers: https://erikflowers.github.io/weather-icons/
* Weather data from: http://openweathermap.org/api
*
*/
(function($) {
@danielme85
danielme85 / danTyper.js
Last active June 15, 2018 14:36
Typewriter effect, made for js/jQuery practice... Try it out at https://codepen.io/anon/pen/rKGwGK
/**
* Created by mellu on 3/3/2017.
*/
(function($) {
$.fn.danTyper = function(strings, options) {
var $this = $(this);
var opts = $.extend({}, $.fn.danTyper.defaults, options);
var speed = opts.speed;
var enableCursor = opts.cursor;
var lines = strings.length;
@danielme85
danielme85 / Media.php
Created August 3, 2017 16:36
A Laravel Model that stores images and sends to TinyPNG API for optimization
<?php
namespace App\Models;
/**
* Created by PhpStorm.
* User: dmellum
* Date: 7/25/17
* Time: 6:04 PM
*/