Skip to content

Instantly share code, notes, and snippets.

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 / 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
@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')
#!/bin/bash
torrentid=$1
torrentname=$2
torrentpath=$3
files=($( ls $torrentpath | grep "mp4\|mkv" ))
for i in ${files[@]}:
do
@izifortune
izifortune / libs-publish.js
Created January 14, 2018 18:41
nrwl libs publish
const { readdir } = require('fs-extra');
const { pexec } = require('./utils');
const publishLibs = async (dirs) => {
for (let dir of dirs) {
const publishResult = await pexec(`npm publish @common/${dir}`);
}
}
@izifortune
izifortune / utils.js
Created January 18, 2018 22:12
nrwl libs utils
const fs = require('fs');
const path = require('path');
const { exec } = require('child_process');
const { parseFiles } = require('@nrwl/schematics/src/command-line/shared');
const { affectedApps } = require('@nrwl/schematics/src/command-line/affected-apps');
const {
readdir
} = require('fs-extra');
@izifortune
izifortune / libs-test.js
Last active January 18, 2018 22:52
Nrwl libs test
const { getAffectedLibs, pexec } = require('./utils');
const libs = getAffectedLibs();
(async () => {
try {
await pexec(`node ./node_modules/.bin/jest ${libs.join(' ')}`)
} catch (e) {
console.error(e);
}
})();