Skip to content

Instantly share code, notes, and snippets.

@izifortune
izifortune / tabnav.js
Created July 22, 2013 20:17
Tab navigation for swiper
this.swiper = new Swiper('.swiper-container',{
centeredSlides: true,
slidesPerView: 'auto',
onSlideClick: function (swiper) {
swiper.swipeTo(swiper.clickedSlide.index());
},
onSlideChangeEnd: function(swiper) {
//Get active slide and work on the callback
var t = swiper.activeSlide();
}
@izifortune
izifortune / parallax effect
Created January 14, 2014 13:15
Simple parallax effect for background image
.parallax-image {
background: url() repeat center center fixed;
background-clip: padding-box;
}
@izifortune
izifortune / 0_reuse_code.js
Created January 24, 2014 16:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
import glob
import os
data = {}
cnt = 1
files = glob.glob("*.svg")
for f in files:
d = open(f, 'r')
content = d.readlines()
svg = []
var debounce = (func, wait, immediate) => {
let timeout;
return () => {
let context = this,
args = arguments;
let later = () => {
timeout = null;
if (!immediate) func.apply(context, args);
}
@izifortune
izifortune / kindle_bulk_delete
Created June 11, 2017 20:30
Select first 10 docs and click delete button
$('.contentTableList_myx .tab_myx a').slice(0, 10).toArray().forEach(el => $(el).trigger('click'));
$('#contentAction_delete_myx > div > a > span > button').trigger('click')
import { TestBed, inject } from '@angular/core/testing';
import {
HttpClientTestingModule,
HttpTestingController
} from '@angular/common/http/testing';
import {
HttpClient,
} from '@angular/common/http';
import { SampleService } from './sample.service';
import { Observable } from 'rxjs';
import { SampleService } from './sample.service';
const mockAirports = {
DUB: { name: 'Dublin' },
WRO: { name: 'Wroclaw' },
MAD: { name: 'Madrid' }
};
describe('Service: SampleService no TestBed', () => {
#!/bin/bash
torrentid=$1
torrentname=$2
torrentpath=$3
files=($( ls $torrentpath | grep "mp4\|mkv" ))
for i in ${files[@]}:
do
@izifortune
izifortune / libs-affected.js
Last active January 18, 2018 22:58
nrwl libs affected
const { getAffectedLibs } = require('./utils');
const libs = getAffectedLibs();
console.log(libs.join(' '));