Skip to content

Instantly share code, notes, and snippets.

View wcoder's full-sized avatar
🎯
Focusing

Yauheni Pakala wcoder

🎯
Focusing
View GitHub Profile
@tdpreece
tdpreece / simple_http_server.sh
Created September 25, 2015 16:38
Running a Python SimpleHTTPServer in the background and killing it when doneSimpleHTTPServer
#!/usr/bin/env bash
# Create a page in the current dir
echo "My Test Page" > test.html
# Start server
python -m SimpleHTTPServer 8000 &> /dev/null &
pid=$!
# Give server time to start up
@paulirish
paulirish / what-forces-layout.md
Last active April 28, 2025 06:24
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@Yimiprod
Yimiprod / difference.js
Last active April 6, 2025 09:16
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
@aspnetde
aspnetde / .View
Last active September 28, 2021 10:11
Xamarin.iOS MemoryUtility
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.MessageUI;
using MonoTouch.UIKit;
namespace MyApp
{
public interface ICanCleanUpMyself
{
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@alexrainman
alexrainman / Connectivity.cs
Last active March 27, 2023 07:45 — forked from emil2k/Connectivity.java
Check device's network connectivity and speed for Xamarin.Android
using System.Threading;
using Android.Content;
using Android.Net;
using Android.Telephony;
using Java.IO;
using Java.Net;
namespace YourNamespace {
/**
@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>()
@Rulexec
Rulexec / resume.md
Last active February 27, 2024 04:16

Alexander Ruliov

  • Written my first "Hello, World!" in 2006 (16 years ago).
  • 28 y.o., Belarus, Minsk (born in Brest).

Experience

Gurtam (4 years, [2017; 2021))

Worked as frontend-developer from 15 December 2016 to 4 January 2021 in Gurtam on Wialon product.

Initially project was built on Vanilla JS (with jQuery) plus there was server-generated HTML by TCL (which was used as PHP). After 2-3 years we started to implement new features on React, eliminated TCL pages, and migrated them to OpenResty (Lua). I hope that it will be migrated then to nodejs/will be fully static frontend (at the time of first migration there was no expertise with nodejs in the company, but there was a team that used Lua).

@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 29, 2025 18:03
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@christopherperry
christopherperry / ExpiringLruCache.java
Last active February 16, 2024 15:12
LruCache for Android with expiring keys. Instead of modifying LruCache directly I used delegation to get around final keyword usage and a dirty hack to override everything else.
import android.os.SystemClock;
import android.support.v4.util.LruCache;
import java.util.HashMap;
import java.util.Map;
/**
* An Lru Cache that allows entries to expire after
* a period of time. Items are evicted based on a combination
* of time, and usage. Adding items past the {@code maxSize}