Skip to content

Instantly share code, notes, and snippets.

View kirilkirkov's full-sized avatar
🎯
Focusing

Kiril Kirkov kirilkirkov

🎯
Focusing
View GitHub Profile
@jonathantneal
jonathantneal / README.md
Created September 19, 2012 06:34
Polyfill the EventListener interface in IE8

EventListener Polyfill

Is IE8 your new IE6? Level the playing field with polyfills.

This script polyfills addEventListener, removeEventListener, and dispatchEvent. It is less than half a kilobyte minified and gzipped.

addEventListener

addEventListener registers a single event listener on a single target.

@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@kirilkirkov
kirilkirkov / install_GoDaddy_SSL
Created February 27, 2018 10:06
Installing GoDaddy SSL Certificate in an Ubuntu Server
There are a lot of guides out there that deals with this topic (installing ssl certificate)
but not much that are actually tailored for this pair, GoDaddy and Ubuntu. So hopefully today’s
article will be helpful for many people.
Elements
Basically in order to successfully install an SSL certificate you need the following things
CSR file
Private key
Certificate key
@rhukster
rhukster / sphp.sh
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@antarikshc
antarikshc / gcp-storage.js
Last active June 26, 2023 17:24
Code sample to upload files in Google Cloud Storage bucket for Node.js
// Install GCP Client library
// npm install --save @google-cloud/storage
// To run the client library, you must first set up authentication by creating a service account
// and setting an environment variable. Ask your DevOps person to provide you with service account key
// For example:
// export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/[FILE_NAME].json"
// Imports the Google Cloud client library
const { Storage } = require('@google-cloud/storage');
@kirilkirkov
kirilkirkov / PaginationModule.js
Last active January 30, 2020 11:47
JS Pagination Class Module for Vuejs Components
export default class Pagination {
constructor(vm, limit, total, page_param_name) {
this.vm = vm
this.limit = parseInt(limit)
this.total = parseInt(total)
this.page_param_name = page_param_name
this.setMaxPagesToShow(5)
this.setDefaultStyles()
@starve-l
starve-l / fluent-ffmpeg-bassboost.js
Created November 4, 2021 17:56
Using `fluent-ffmpeg` to bass boost an audio file.
ffmpeg().input("input.mp3").outputOptions("-af bass=g=3").save("output.mp4");