Skip to content

Instantly share code, notes, and snippets.

@seripap
seripap / nike.dist.php
Last active August 29, 2015 14:03
Nike+ to RunKeeper Importer
<?php
/**
* GPX to Runkeeper mass data importer
*
* @author Daniel Seripap <daniel@seripap.com>
* @copyright Daniel Seripap (c) 2014
* @version 1.0
* @license MIT
*
* This uses the HealthGraph API wrapper to import GPX data to Runkeeper.
+1
3
8-bit
90's
Actually
Aesthetic
American
Anderson
Apparel
Art
@seripap
seripap / gist:e1403f3d8ef26d329037
Created June 16, 2015 20:22
Find + Delete DIR
# Directory
find / -type d -name '*wildcard*' -exec rm -r "{}" \;
@seripap
seripap / gist:d3bd65b284980cb4783e
Created July 1, 2015 14:53
ffmpeg: get duration of video
ffmpeg -i file.mp4 2>&1 | grep Duration | awk '{print $2}' | tr -d ,
@seripap
seripap / nginx.conf
Last active November 12, 2015 20:10 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@seripap
seripap / domain.js
Created December 18, 2015 16:05
DNS domain check
'use strict';
import dns from "dns";
import sys from "sys";
import fs from "fs";
const items = JSON.parse(fs.readFileSync('./shake.json'));
function checkAvailable(name, callback) {
dns.resolve4( name, (err, addresses) => {
@seripap
seripap / crawl.js
Created December 18, 2015 16:08
Simple NodeJS Link Crawler
'use strict';
import Crawler from "simplecrawler";
import fs from 'fs';
Crawler.crawl("http://www.google.com").on("fetchcomplete", (queueItem, responseBuffer, response) => {
console.log("Completed fetching resource:", queueItem.url);
if (queueItem.url.indexOf('png') > 0 || queueItem.url.indexOf('jpg') > 0 || queueItem.url.indexOf('gif') > 0 || queueItem.url.indexOf('jpeg') > 0) {
let filename = queueItem.url.substring(queueItem.url.lastIndexOf('/')+1);
@seripap
seripap / .zshrc
Created March 2, 2016 14:33
Squash commit (bash/profile)
# squash integer
function squash() {
git rebase -i HEAD~${1}
}
@seripap
seripap / gist:d4fa0e47f5dc872a7b7b
Created March 28, 2016 18:43
Docker - Remove all images
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
@seripap
seripap / csv_to_array.php
Created July 22, 2016 20:12 — forked from jaywilliams/csv_to_array.php
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array