Skip to content

Instantly share code, notes, and snippets.

View tiger8888's full-sized avatar
🎯
Focusing

tiger8888

🎯
Focusing
View GitHub Profile
@tiger8888
tiger8888 / bh_core.sublime-settings
Created August 23, 2021 08:34 — forked from Narretz/bh_core.sublime-settings
Sublime Text BracketHighlighter settings for Vue Component
{
// Rule definitions for finding and matching brackets.
// Brackets are found by using regex and can use scope
// qualifiers exclude certain matches.
// Once all matches are found, the closest pair surrounding
// the cursor are selected.
"brackets": [
// Basic brackets
{
"name": "curly",
@tiger8888
tiger8888 / jquery-ajax-blob-arraybuffer.js
Created June 9, 2020 08:42 — forked from SaneMethod/jquery-ajax-blob-arraybuffer.js
Ajax transports to allow the sending/receiving of blobs and array buffers via the familiar jquery ajax function.To send, set data to the blob or arraybuffer to be sent, and add 'processData:false' to the ajax options.To receive, specify the 'dataType' as blob or arraybuffer in the ajax options.
(function($){
/**
* Register ajax transports for blob send/recieve and array buffer send/receive via XMLHttpRequest Level 2
* within the comfortable framework of the jquery ajax request, with full support for promises.
*
* Notice the +* in the dataType string? The + indicates we want this transport to be prepended to the list
* of potential transports (so it gets first dibs if the request passes the conditions within to provide the
* ajax transport, preventing the standard transport from hogging the request), and the * indicates that
* potentially any request with any dataType might want to use the transports provided herein.
*
@font-face {
font-family: 'cicle_gorditagordita';
src: url('fonts/Cicle_Gordita-webfont.eot');
src: url('fonts/Cicle_Gordita-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/Cicle_Gordita-webfont.woff') format('woff'),
url('fonts/Cicle_Gordita-webfont.ttf') format('truetype'),
url('fonts/Cicle_Gordita-webfont.svg#cicle_gorditagordita') format('svg');
font-weight: normal;
font-style: normal;
@tiger8888
tiger8888 / Less Retina Mixin Utility Class
Created February 22, 2019 00:37 — forked from erikflowers/Less Retina Mixin Utility Class
I took this from the retina.js solution and modified it a bit. All credit goes to https://github.com/imulus/retinajs, I just tweaked this for my needs. This mixin includes most of the parameters you need, so you don't need to call them out twice. It can all be done in the mixin.
// the retina mixin. An example goes: .at2x(img/header@2x.png, 650px, 150px, top, left, no-repeat, scroll)
// Put the size that the image appears on a non-retina, e.g. if it's a 200px x 200px non-retina, that is the effective size. The @2x 400px x 400px is calculated automatically. The order to type it is width then height.
// A modification of the retina.js less mixin - https://github.com/imulus/retinajs
@highdpi: ~"(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)";
.at2x(@path, @w: auto, @h: auto, @xpos: 0, @ypos: 0, @repeat: no-repeat, @attachment: scroll) {
background-image: url(@path);
background-position: @xpos @ypos;
background-repeat: @repeat;
// the retina mixin. An example goes: .at2x(img/header@2x.png, 650px, 150px, top, left, no-repeat, scroll)
// Put the size that the image appears on a non-retina, e.g. if it's a 200px x 200px non-retina, that is the effective size. The @2x 400px x 400px is calculated automatically. The order to type it is width then height.
// A modification of the retina.js less mixin - https://github.com/imulus/retinajs
@highdpi: ~"(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)";
.at2x(@path, @w: auto, @h: auto, @xpos: 0, @ypos: 0, @repeat: no-repeat, @attachment: scroll) {
background-image: url(@path);
background-position: @xpos @ypos;
background-repeat: @repeat;
@tiger8888
tiger8888 / LESS mixin for CSS arrow
Created February 22, 2019 00:30 — forked from julienchazal/LESS mixin for CSS arrow
LESS mixin for CSS arrow
/* ------------------------ */
/* LESS mixin for CSS arrow */
/* ------------------------ */
/* https://github.com/HugoGiraudel/LESS-Mixin-for-CSS-arrows
//Usage
.arrow(size, color, direction, offset, border-size, border-color);
Where
@tiger8888
tiger8888 / gist:b9e248035a86c9a87076dd7d7a00185b
Created February 20, 2019 10:39 — forked from smokinjoe/gist:5861897
Simple way to create a 'bounce' effect with css's keyframes
.myBounceDiv {
-moz-animation:bounce .40s linear;
-webkit-animation:bounce .40s linear;
}
@-moz-keyframes bounce {
0%{ -moz-transform:scale(0); opacity:0;}
50%{ -moz-transform:scale(1.3); opacity:0.4; }
75%{ -moz-transform:scale(0.9); opacity:0.7;}
100%{ -moz-transform:scale(1); opacity:1;}
@tiger8888
tiger8888 / cheat-sheet.js
Created February 20, 2019 02:14 — forked from brianneisler/cheat-sheet.js
Cheat sheet - es6 import/export mixed with require/modules.exports
require('./module.js') // { a: 1 }
import module from './module.js' // undefined
import { a } from './module.js' // 1
require('./module2.js') // { default: { a: 1 }, b: 2 }
import module2 from './module2.js' // { a: 1}
import { b } from './module2.js' // 2
require('./module3.js') // { default: { a: 1 }, b: 2 }
@tiger8888
tiger8888 / iframe.html
Last active December 3, 2018 08:39 — forked from cirocosta/iframe.html
Sending messages from child iframe to parent webpage
<!DOCTYPE html>
<html>
<head>
<title>My Iframe</title>
</head>
<body>
<button>Botão</button>
<script type="text/javascript">
@tiger8888
tiger8888 / img2b64.sh
Created October 30, 2018 10:11
Encode images (.png, .jpg, .gif) to base64 format
#!/bin/sh
# R0lGOD image/gif
# /9j/4 image/jpeg
# JVBERi0xLj application/pdf
# PCFET0NUWVBFI text/html
echo "data:image/png;base64," > $1.b64 && "base64" $1 >> $1.b64