Skip to content

Instantly share code, notes, and snippets.

View ivuorinen's full-sized avatar

Ismo Vuorinen ivuorinen

View GitHub Profile
@ivuorinen
ivuorinen / heartRain.html
Created January 30, 2018 22:06
heartRain.html
<!DOCTYPE html>
<html>
<head>
<title>heartrain</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
if(!image_urls) {
var image_urls = Array()
}
if(!flash_urls) {
@ivuorinen
ivuorinen / laravel-homestead-xdebug.sh
Last active August 2, 2019 09:36
Enable xdebug for all PHP versions available on Laravel Homestead
#!/usr/bin/env bash
# Laravel Homestead
# Enable xdebug on all PHP versions (cli)
# Best place for this is in the user-customizations.sh in the Homestead folder
PHPV=$(ls /etc/php/)
for i in ${PHPV[@]}; do
if [ ! -f /etc/php/$i/cli/conf.d/20-xdebug.ini ]; then
sudo ln -s /etc/php/$i/mods-available/xdebug.ini /etc/php/$i/cli/conf.d/20-xdebug.ini
fi
@ivuorinen
ivuorinen / sleep.js
Created September 7, 2017 09:13
sleep.js
/**
* sleep(1000).then(function () { console.log('zzZZzzZZ...'); });
*
* @author gsamaras <https://stackoverflow.com/a/951057/594940>
* @param {Integer} ms
* @returns {Promise}
*/
window.sleep = function sleep(ms) {
return (
new Promise(function (resolve, reject) {
@ivuorinen
ivuorinen / keybase.md
Created June 15, 2016 06:14
Keybase proof

Keybase proof

I hereby claim:

  • I am ivuorinen on github.
  • I am ivuorinen (https://keybase.io/ivuorinen) on keybase.
  • I have a public key whose fingerprint is 2ACD 5CFD 6298 A83B 16D9 DBCD 7D19 3B92 F274 2794

To claim this, I am signing this object:

@ivuorinen
ivuorinen / entities.php
Created September 20, 2015 07:56
psr2-fixed, docblocked and 80-char width safe version
<?php
/**
* makeSafeEntities()
*
* Convert str to UTF-8 (if not already), then convert that to HTML named
* entities and numbered references.
* Compare to native htmlentities() function. Unlike that function,
* this will skip any already existing entities in the string.
*
* - mb_convert_encoding() doesn't encode ampersands, so use
@ivuorinen
ivuorinen / mkvsubs.sh
Created January 30, 2015 07:31
MKV Subtitle extraction
#!/bin/bash
# Ismo Vuorinen <[email protected]>, 2014
SCRIPTNAME=`basename $0`
# If no directory is given, work in local dir
if [ "$1" = "" ]; then
DIR="."
else
DIR="$1"
@ivuorinen
ivuorinen / robots.txt
Created April 15, 2013 09:18
Koko sivuston poistaminen Googlen ja muiden hakukoneiden listauksista
User-agent: *
Disallow: /
@ivuorinen
ivuorinen / debug.php
Last active January 5, 2018 07:33
debug() to aid in your development
<?php
/**
* debug
* a magical function to use in your code
*
* @author Ismo Vuorinen <https://github.com/ivuorinen>
*
* @param mixed $thing The thing you want to see
* @param bool $echo Should we return or echo the output [default: false]
@ivuorinen
ivuorinen / ongelma.txt
Created August 16, 2012 10:50
Verkkokaupan tuotteiden tilaukseen PHP-looppaus
$obj = 0->
title-> Koko
options-> l = L
xl = XL
xxl = XXL
1->
title-> Väri
options-> musta = Musta
vihrea = Vihreä
@ivuorinen
ivuorinen / email_obfuscation.php
Created December 2, 2011 19:30
Email Obfuscation Shortcode for WordPress
<?php
/*
Plugin Name: Email Obfuscation Shortcode
Plugin URI: https://gist.github.com/1424515
Description: Shortcode for including emails into content and keeping spambots clueless. [obf email="[email protected]" noscript="what's shown to bots/people without javascript"]
Version: 0.1
Author: Ismo Vuorinen
Author URI: http://github.com/ivuorinen
*/