Skip to content

Instantly share code, notes, and snippets.

View embarq's full-sized avatar
🕶️
Working hard

Li Ihor embarq

🕶️
Working hard
View GitHub Profile
@embarq
embarq / aria-roles.html
Created July 7, 2016 12:28
A simplified example of using ARIA-role attributes
<a href="/" role="banner"><img src="logo.png" alt="" />Блог Васи Пупкина</a>
<nav role="navigation">
<ul>
<li><a href="/">Главная</a></li>
<li><a href="/news">Новости</a></li>
<li><a href="/contacts">Контакты</a></li>
</ul>
</nav>
$background: #f9f9f9;
$button-background: #d3d8dd;
$footer-background: #373d44;
$main-color: #04bf9d;
$about-us-icon-background: #373d44;
$text-color: #bbbaba;
$list-first-color: #bbbaba;
$list-second-color: #fafafa;
/// Move to "_reset.scss"
@embarq
embarq / remmer.js
Last active August 17, 2016 22:49
Converts rem to px units in each *.scss file in "src" dir
"use strict";
var fs = require('fs');
var src = 'stylesheets/';
var dist = 'dist';
var walk = (dir, callback) => {
var results = [];
fs.readdir(dir, (err, list) => {
if (err) {
# This is Git's per-user configuration file.
[alias]
b = "!git branch"
c = "!git commit -m" # regular shorthand
ca = "!git commit --amend --no-edit" # add to stage again
ch = "!git checkout"
cm = "!git add -A && git commit -m"
ds = "!git diff --staged -w"
lg = "!git log --pretty=format:'%C(bold red)%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold red)<%an>%Creset' --abbrev-commit"
ll = "!git lg -5 --stat"
@embarq
embarq / Program.cs
Created August 11, 2016 23:20
Simple task-based async code descripting
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Async
{
class Program
{
static void Main(string[] args)
{
@embarq
embarq / ControlInvokeRequired.cs
Last active August 12, 2016 00:23
Helper method to determin if invoke required
/// <summary>
/// Helper method to determin if invoke required, if so will rerun method on correct thread.
/// if not do nothing.
/// </summary>
/// <param name="c">Control that might require invoking</param>
/// <param name="a">action to preform on control thread if so.</param>
/// <returns>true if invoke required</returns>
public bool ControlInvokeRequired(Control c, System.Action a)
{
if (c.InvokeRequired)
@embarq
embarq / huge.json
Created August 19, 2016 01:54
17mb of mock data
This file has been truncated, but you can view the full file.
[
{
"Email": "Eric.Torp@deanna.us",
"Full Name": "Sadye Lemke",
"Country": "Japan",
"User Id": 0,
"Created At": "1993-06-25T17:22:34.026Z"
},
{
"Email": "Jarrett@sonny.me",
@embarq
embarq / fabric-pattern.cpp
Last active September 8, 2016 16:42
http:// cpp.sh/4jcf
#include <iostream>
#include <vector>
class Cattle {
public:
virtual void info() {};
virtual ~Cattle() {};
};
class Cow : public Cattle {
@embarq
embarq / reflow.cpp
Last active September 20, 2016 08:00
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
struct Pair {
double a;
double b;
};