Skip to content

Instantly share code, notes, and snippets.

View wcoder's full-sized avatar
🎯
Focusing

Yauheni Pakala wcoder

🎯
Focusing
View GitHub Profile
@wcoder
wcoder / asd.cs
Last active August 29, 2015 14:04
using System;
using System.Threading.Tasks;
using Windows.UI.Xaml.Controls;
namespace POCWebViewUniversal
{
class Auth
{
private const string MainPage = "";
private const string LoginPage = "";
@wcoder
wcoder / IoC.cs
Last active November 19, 2019 13:53
Static IoC container
public static class SimpleIoc
{
private static readonly ConcurrentDictionary<Type, object> _dependencyMap = new ConcurrentDictionary<Type, object>();
public static void Register<TName>(object instance)
{
_dependencyMap.TryAdd(typeof(TName), instance);
}
public static T Get<T>()
(function(){
// by https://gist.github.com/wcoder/10601500
var shuffleArray = function (array) {
for (var j, x, i = array.length; i;)
{
j = j = parseInt(Math.random() * i);
x = array[--i];
array[i] = array[j];
array[j] = x;
@wcoder
wcoder / mixer.js
Created April 13, 2014 20:42
Class for mixing
/**
* Class for mixing
*
* Use:
* var input = document.querySelector('#input').innerText;
* var output = Mixer.shuffleString(input);
*/
(function(w) {
var mixer = {};
@wcoder
wcoder / global.js
Created April 13, 2014 20:38
Array Remove - By John Resig
// Array Remove - By John Resig (MIT Licensed)
Array.prototype.remove = function (from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
};
@wcoder
wcoder / wrap_pre.css
Created March 29, 2014 11:19
Wrap space for <pre>
pre {
white-space: pre-wrap; /* Chrome & Safari */
white-space: -moz-pre-wrap; /* Mozilla since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
@wcoder
wcoder / tags.html
Created March 29, 2014 11:18
Meta tags for responsive page
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="HandheldFriendly" content="true">
@wcoder
wcoder / reset_standart_styles.css
Created March 29, 2014 11:16
Reset browser styles
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
outline: none;
}
html { height: 101%; } /* always display scrollbars */