Skip to content

Instantly share code, notes, and snippets.

View ViliamKopecky's full-sized avatar
🤡
clowning

Viliam Kopecký ViliamKopecky

🤡
clowning
View GitHub Profile
@ViliamKopecky
ViliamKopecky / less-path-variables.less
Created December 14, 2011 02:35
Personal suggestion for LESS path variables
/**
*
* Suggestion for LESS syntax - path variables (2011-12-14)
* By Viliam Kopecky <enoice(at)gmail>
*
**/
// LESS SOURCE
/browser/ {
<?php
require_once __DIR__ . '/clevis/Eleda/libs/Nette/loader.php';
require_once __DIR__ . '/clevis/Eleda/libs/dibi/dibi.php';
use Nette\Utils\Strings as Strings;
dibi::connect(array(
'host' => 'localhost',
'username' => 'root',
@ViliamKopecky
ViliamKopecky / less-refresh-bookmark.js
Created April 25, 2012 02:30
LESS/CSS each-second-refresh bookmark js
// ON/OFF switch LESS refreshing bookmark
(function(){
window.lessRefreshing = !window.lessRefreshing;
console.log('LESS refreshing: '+(window.lessRefreshing ? 'ON' : 'OFF'));
var rf = function(){
if(window.lessRefreshing) {
less.refresh();
setTimeout(rf, 1000);
} else {
@ViliamKopecky
ViliamKopecky / simple_curl.php
Created May 10, 2012 00:57
Simple cURL wrapper function for GET, POST, PUT & DELETE methods
/**
* Wrapper for easy cURLing
*
* @author Viliam Kopecký
*
* @param string HTTP method (GET|POST|PUT|DELETE)
* @param string URI
* @param mixed content for POST and PUT methods
* @param array headers
* @param array curl options
var watch_dir = './www/less';
var files = {
// 'input.less': 'output.css'
'./www/less/screen.less': './www/css/screen.css'
};
var interval = 100; // ms
var fs = require('fs');
@ViliamKopecky
ViliamKopecky / dynamic-font-size.as
Created October 31, 2012 14:20
Dynamická velikost fontu podle maximální výšky
// -- funkce vezme TextField, vyzkouší na něj různý velikosti písma a vybere tu nejbližší maxHeight --
var fit = function(txt:TextField, maxHeight:Number) {
var format:TextFormat = text_txt.getTextFormat();
// -- 300 je největší povolená veliksot písma - to by se asi stávat nemělo --
for(var k=300;1<k;k--) {
format.size = k;
text_txt.setTextFormat(format);
if(text_txt.textHeight <= maxHeight) {
@ViliamKopecky
ViliamKopecky / 0_reuse_code.js
Created December 12, 2013 13:19
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
@ViliamKopecky
ViliamKopecky / designer.html
Last active August 29, 2015 14:07
designer
<link href="../code-mirror/code-mirror.html" rel="import">
<link href="../chart-js/chart-js.html" rel="import">
<link href="../cool-clock/cool-clock.html" rel="import">
<link href="../google-map/google-map.html" rel="import">
<link href="../core-menu/core-submenu.html" rel="import">
<link href="../core-item/core-item.html" rel="import">
<link href="../core-menu-button/core-menu-button.html" rel="import">
<link href="../core-icons/core-icons.html" rel="import">
<polymer-element name="my-element">
@ViliamKopecky
ViliamKopecky / designer.html
Last active August 29, 2015 14:07
designer
<link href="../paper-calculator/paper-calculator.html" rel="import">
<link href="../topeka-elements/theme.html" rel="import">
<link href="../topeka-elements/topeka-resources.html" rel="import">
<link href="../topeka-elements/topeka-app.html" rel="import">
<link href="../topeka-elements/avatars.html" rel="import">
<link href="../core-icon/core-icon.html" rel="import">
<link href="../topeka-elements/topeka-datasource.html" rel="import">
<polymer-element name="my-element">
@ViliamKopecky
ViliamKopecky / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;