Skip to content

Instantly share code, notes, and snippets.

@hellomoto177
hellomoto177 / downloadBlob.ts
Last active July 16, 2021 07:40
Download blob
export const downloadBlob = (blob: Blob, filename?: string) => {
if (!blob) return;
const blobURL = window.URL.createObjectURL(blob);
if (filename) {
const a = document.createElement('a');
if (blob.type !== 'application/pdf') {
a.download = filename;
@hellomoto177
hellomoto177 / animateCss and waypoints
Created November 18, 2016 09:35
animateCss and waypoints
(function($) {
$.fn.animated = function(inEffect) {
$(this).each(function() {
var ths = $(this);
ths.css("opacity", "0").addClass("animated").waypoint(function(dir) {
if (dir === "down") {
ths.addClass(inEffect).css("opacity", "1");
};
}, {
offset: "90%"
[
{ "keys": ["e", "u"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
{ "keys": ["c"], "command": "enter_insert_mode",
[
{ "keys": ["e", "u"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
{ "keys": ["c"], "command": "enter_insert_mode",
function heightDetect() {
$(".main_head").css("height", $(window).height());
}
heightDetect();
<div class="loader">
<div class="loader_inner"></div>
</div>
.loader {
background: none repeat scroll 0 0 #ffffff;
bottom: 0;
height: 100%;
left: 0;
position: fixed;