Skip to content

Instantly share code, notes, and snippets.

View ki11ua's full-sized avatar

Georgios Papadimitrou ki11ua

  • the world is my playground
View GitHub Profile
@ki11ua
ki11ua / 2018-https-localhost.md
Created July 18, 2019 06:55 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@ki11ua
ki11ua / carousel-indicators.js
Created June 13, 2018 15:31 — forked from dvsqz/carousel-indicators.js
Auto-generate Bootstrap Carousel Indicator HTML
@ki11ua
ki11ua / custom-quick-modal.html
Created May 17, 2018 16:08
Custom Quick Modal
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {font-family: Arial, Helvetica, sans-serif;}
/* The Modal (background) */
.modal {
display: none; /* Hidden by default */
<?php
/**
* Plugin Name: Static Templates
*
* If most of your site content is in .php template files, and you're tired of
* creating new pages, assigning them page templates, creating page templates
* then doing it all over again on production, this plugin is for you.
*
* Examples:
*
@ki11ua
ki11ua / the_slug.php
Created February 13, 2018 08:55 — forked from greglinch/the_slug.php
create the_slug() function for WordPress
function the_slug($echo=true){
$slug = basename(get_permalink());
do_action('before_slug', $slug);
$slug = apply_filters('slug_filter', $slug);
if( $echo ) echo $slug;
do_action('after_slug', $slug);
return $slug;
}
// credit: http://www.tcbarrett.com/2011/09/wordpress-the_slug-get-post-slug-function/
@ki11ua
ki11ua / node-weather.js
Created February 7, 2018 11:48 — forked from ydn/node-weather.js
Weather API
var YQL = require('yql');
var query = new YQL('select * from weather.forecast where (location = 94089)');
query.exec(function(err, data) {
var location = data.query.results.channel.location;
var condition = data.query.results.channel.item.condition;
console.log('The current weather in ' + location.city + ', ' + location.region + ' is ' + condition.temp + ' degrees.');
});
@ki11ua
ki11ua / yahoo_exchange_rates_jsonp.html
Created February 7, 2018 11:46 — forked from henrik/yahoo_exchange_rates_jsonp.html
JavaScript to get currency exchange rates from Yahoo Finance as JSONP. No XHR!
Get exchange rate as JSONP via YQL.
YQL Console: http://developer.yahoo.com/yql/console
Query (USD to SEK): select rate,name from csv where url='http://download.finance.yahoo.com/d/quotes?s=USDSEK%3DX&f=l1n' and columns='rate,name'
Example code:
<script type="text/javascript">
@ki11ua
ki11ua / slice-slider.css
Last active May 25, 2020 00:31
Slice Slider with Interval
.slides-nav {
z-index: 99;
position: fixed;
right: -5%;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
@ki11ua
ki11ua / istouch.js
Created January 31, 2018 07:15
Test forf Touch Device
function isTouchDevice(){
return true == ("ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch);
}
if(!isTouchDevice() && window.outerWidth > 1199){
}
"use strict";
/* A version number is useful when updating the worker logic,
allowing you to remove outdated cache entries during the update.
*/
var version = 'v1::';
/* These resources will be downloaded and cached by the service worker
during the installation process. If any resource fails to be downloaded,
then the service worker won't be installed either.