Skip to content

Instantly share code, notes, and snippets.

View blogui91's full-sized avatar
🎯
Focusing

Cesar Santana blogui91

🎯
Focusing
  • Doorvel
  • Monterrey
  • 00:07 (UTC -06:00)
View GitHub Profile
@muammar
muammar / getFirafonts.sh
Created May 23, 2016 08:41
Download and install Fira fonts in Linux or Mac OS X
#!/bin/bash
## cf from http://programster.blogspot.com/2014/05/ubuntu-14-desktop-install-fira-sans-and.html
cd /tmp
# install unzip just in case the user doesn't already have it.
if [[ `uname` = Linux ]]; then
sudo apt-get install unzip -y
wget "http://www.carrois.com/downloads/fira_4_1/FiraFonts4106.zip"
@nate-strauser
nate-strauser / Materialize CSS - Modal Fixed Header
Created May 18, 2016 19:49
How to have a fixed modal header with materializecss
Modal Markup:
<div class="modal modal-fixed-header">
<div class="modal-header">
HEADER CONTENT
</div>
<div class="modal-content">
MAIN CONTENT
</div>
</div>
@niksumeiko
niksumeiko / disable-html-form-input-autocomplete-autofill.md
Last active April 1, 2025 23:38
Disable HTML form input autocomplete and autofill

Disable HTML Form Input Autocomplete and Autofill

  1. Add autocomplete="off" onto <form> element;
  2. Add hidden <input> with autocomplete="false" as a first children element of the form.
<form autocomplete="off" method="post" action="">
    <input autocomplete="false" name="hidden" type="text" style="display:none;">
    ...
@phillipsharring
phillipsharring / Kernel.php
Last active October 9, 2023 13:11 — forked from kkiernan/MySqlDump.php
Laravel Artisan command to perform MySQL Dump using database connection information in the .env file. Posted 2016 Jan. Unsupported. Forked from https://gist.github.com/kkiernan/bdd0954d0149b89c372a
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
@inexorabletash
inexorabletash / @ Indexed DB URLs via Service Workers.md
Last active February 17, 2025 21:36
Indexed DB URLs via Service Workers

URLs into Indexed DB, via Service Workers

Let's say you're using Indexed DB for the offline data store for a catalog. One of the object stores contains product images. Wouldn't it be great if you could just have something like this in your catalog page?

<img src="indexeddb/database/store/id">
@ferreiro
ferreiro / BinomialCoefficient.js
Created August 29, 2015 11:32
Binomial coefficient in javascript
// Binomial coefficient
// Credits: github.com/jgferreiro
examples();
function examples() {
var a, b; // numerator and denominator of our coeffiecient
a = 2; b = 1;
console.log('Binomial for a = ' + a + " and b = "+ b + ' is ' + binomialCoefficient(a, b));
@fractefactos
fractefactos / pivot_example.php
Last active October 17, 2022 08:47 — forked from lighta971/pivot_example.php
Laravel Custom Pivot Model definition example
<?php
//https://github.com/laravel/framework/issues/2093#issuecomment-39154456
use Illuminate\Database\Eloquent\Model as Eloquent;
use Illuminate\Database\Eloquent\Relations\Pivot;
class User extends Eloquent {
public function groups() {
return $this->belongsToMany('Group');
@gilbarbara
gilbarbara / .editorconfig
Created May 20, 2015 23:56
basic .editorconfig fille
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# change these settings to your own preference
indent_style = space
indent_size = 4
@ifraixedes
ifraixedes / LICENSE
Last active August 13, 2021 14:51
Private properties on ES6 Classes using Proxies
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004
(http://www.wtfpl.net/about/)
Copyright (C) 2015 Ivan Fraixedes (https://ivan.fraixed.es)
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@gerard-kanters
gerard-kanters / inactivity.js
Last active October 30, 2024 16:25
Inactivity timeout javascript
<script type="text/javascript">
function idleTimer() {
var t;
//window.onload = resetTimer;
window.onmousemove = resetTimer; // catches mouse movements
window.onmousedown = resetTimer; // catches mouse movements
window.onclick = resetTimer; // catches mouse clicks
window.onscroll = resetTimer; // catches scrolling
window.onkeypress = resetTimer; //catches keyboard actions