var protoUrl = "tg:\/\/resolve?domain=TelegramUserName";
if (false) {
var iframeContEl = document.getElementById('telegramIframe') || document.body;
var iframeEl = document.createElement('iframe');
iframeContEl.appendChild(iframeEl);
var pageHidden = false;
window.addEventListener('pagehide', function () {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_avatar_from_service(service, userid, size) { | |
// this return the url that redirects to the according user image/avatar/profile picture | |
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback | |
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px ) | |
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word ) | |
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px ) | |
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word ) | |
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px ) | |
// everything else will go to the fallback | |
// google and gravatar scale the avatar to any site, others will guided to the next best version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const webpack = require('webpack'); | |
const config = { | |
entry: "./app/app.js", | |
output: { | |
filename: 'app.min.js', | |
path: './public/static/' | |
}, | |
devtool: "eval-source-map", |
A business card concept I created for a little challenge over at http://reddit.com/r/web_design!
A Pen by Eduard Kosicky on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// convert 0..255 R,G,B values to binary string | |
RGBToBin = function(r,g,b){ | |
var bin = r << 16 | g << 8 | b; | |
return (function(h){ | |
return new Array(25-h.length).join("0")+h | |
})(bin.toString(2)) | |
} | |
// convert 0..255 R,G,B values to a hexidecimal color string | |
RGBToHex = function(r,g,b){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(global, factory) { | |
/*global define: false*/ | |
/*global exports: true*/ | |
if (typeof exports === 'object' && exports) { | |
factory(exports); // CommonJS | |
} else if (typeof define === 'function' && define.amd) { | |
define(['exports'], factory); // AMD | |
} else { | |
factory(global); // <script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <refrence path="https://jsfiddle.net/dm1ufzz3/" /> | |
function QueryStringToJSON(str) { | |
var pairs = str.split('&'); | |
var result = {}; | |
pairs.forEach(function (pair) { | |
pair = pair.split('='); | |
var name = pair[0] | |
var value = pair[1] | |
if (name.length) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* npm install --save-dev webpack babel-loader babel-core babel-preset-{es2015,react} style-loader css-loader sass-loader | |
* npm install --save react react-dom | |
* directory folders: static, public | |
*/ | |
const path = require("path"); | |
const webpack = require("webpack"); | |
module.exports = { |
OlderNewer