Skip to content

Instantly share code, notes, and snippets.

View wcoder's full-sized avatar
🎯
Focusing

Yauheni Pakala wcoder

🎯
Focusing
View GitHub Profile
var str = "Hello World!";
function rev1(s){return s.split('').reduce(function(a,b){return b+a;}).join('');}
function rev2(s){return s.split('').reverse().join('');}
console.log(rev1(str));
console.log(rev2(str));
@wcoder
wcoder / gist:342ff831a8a6b32f315d
Last active August 29, 2015 14:22
styles for WP webView from ionic
*, *:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }
html {
overflow: hidden;
-ms-touch-action: pan-y;
touch-action: pan-y; }
@wcoder
wcoder / timer.js
Last active August 29, 2015 14:23
Simple timer with JS
/**
* @param seconds - time
* @param tick - callback
* @param result - callback
*/
function timer (seconds, tick, result) {
if (seconds > 0) {
tick(seconds);
seconds -= 1;
setTimeout(function () {
class JsonHelper
{
public static string FormatJson(string str, string indentString = "\t")
{
var indent = 0;
var quoted = false;
var sb = new StringBuilder();
for (var i = 0; i < str.Length; i++)
{
var ch = str[i];
@wcoder
wcoder / ios-dist.txt
Created December 30, 2015 20:21
Link for iOS distribution
itms-services://?action=download-manifest&url=http://loqi.me/app/Geoloqi.plist
From: http://aaronparecki.com/articles/2011/01/21/1/how-to-distribute-your-ios-apps-over-the-air
@wcoder
wcoder / IRemove.cs
Last active February 27, 2016 20:15 — forked from jamesmontemagno/IRemove.cs
A simple and Intuitive Xamarin.iOS + MvvmCross TableView swipe to delete implementation. This will allow you to have any number of ViewModels simply implement IRemove.cs and all you need is MvxDeleteStandarTableViewSource and implement the interface in your viewmodels! I should say that these are edited classes, you should implement some of the …
public interface IRemove
{
ICommand RemoveCommand { get; }
}
@wcoder
wcoder / nodeapp.conf
Created January 17, 2016 17:03
unstart config (/etc/init/) for run node.js app as the service
description "node.js server"
author "Yuaheni Pakala"
# used to be: start on startup
# until we found some mounts weren't ready yet while booting:
start on started mountall
stop on shutdown
# Automatically Respawn:
respawn
public class BaseViewModel : BaseNotify
{
bool _isBusy = false;
CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
public bool IsBusy
{
get
{
return _isBusy;
@wcoder
wcoder / consoleDownload.md
Last active June 8, 2017 06:58
Download file form internet with Windows console

** PowerShell

Invoke-WebRequest -Uri 'http://url' -OutFile 'D:\downloaded_file'
(New-Object System.Net.WebClient).DownloadFile('http://url', 'D:\downloaded_file')
@wcoder
wcoder / block_skype_hosts.md
Last active June 8, 2017 07:02
Hosts for disabling AD Banners in Skype

Edit: %SystemRoot%\system32\drivers\etc\hosts

127.0.0.1 devads.skypeassets.net devapps.skype.net
127.0.0.1 qawww.skypeassets.net qaapi.skype.net
127.0.0.1 preads.skypeassets.net preapps.skype.net
127.0.0.1 static.skypeassets.com serving.plexop.net
127.0.0.1 preg.bforex.com ads1.msads.net
127.0.0.1 flex.msn.com apps.skype.com