Skip to content

Instantly share code, notes, and snippets.

View vladskiy's full-sized avatar

Vladislav Lipskiy vladskiy

  • Lebara Ltd
  • London, UK
View GitHub Profile
package pl.mkaras.utils;
import android.content.Context;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.Toolbar;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
@scottsb
scottsb / casesafe.sh
Last active January 16, 2024 08:47 — forked from Hais/workspace.sh
Create and manage a case-sensitive disk-image on macOS (OS X).
#!/bin/bash
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
MOUNT_POINT="${CASE_SAFE_MOUNT_POINT:-${HOME}/casesafe}"
VOLUME_PATH="${CASE_SAFE_VOLUME_PATH:-${HOME}/.casesafe.dmg.sparseimage}"
VOLUME_NAME="${CASE_SAFE_VOLUME_NAME:-casesafe}"
VOLUME_SIZE="${CASE_SAFE_VOLUME_SIZE:-60g}"
@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links
@nhachicha
nhachicha / Synchronizers.java
Created October 29, 2015 16:32
Examples using synchronizers (CountDownLatch, CyclicBarrier, Phaser)
// ********************************************************************* //
// ************************** CountDownLatch ************************** //
// ********************************************************************* //
public class RandomIntAverage {
CountDownLatch controller = new CountDownLatch(NB_THREADS);
public void randomIntAvg() throws InterruptedException {
for (int i = 0; i < NB_THREADS; i++) {
new Thread(new Task()).start();
}
@terhechte
terhechte / pattern-examples.swift
Created August 22, 2015 15:29
Swift pattern examples for the swift, for, and guard keywords
import Foundation
// 1. Wildcard Pattern
func wildcard(a: String?) -> Bool {
guard case _? = a else { return false }
for case _? in [a] {
return true
}
@AliSoftware
AliSoftware / struct_vs_inheritance.swift
Last active March 27, 2024 11:57
Swift, Struct & Inheritance: How to balance the will of using Struct & Value Types and the need for Inheritance?
// #!Swift-1.1
import Foundation
// MARK: - (1) classes
// Solution 1:
// - Use classes instead of struct
// Issue: Violate the concept of moving model to the value layer
// http://realm.io/news/andy-matuschak-controlling-complexity/
@robatron
robatron / fallout-1-high-res-patch-mac-osx.md
Last active May 6, 2024 12:55
How to get the Fallout 1 (and Fallout 2) high-resolution patch working for Mac OS X

Fallout 1 (and Fallout 2) Hi-Res Patch for Mac OS X

Fallout 1 was originally designed to run at 640x480 resolution. I wanted to run the Mac OS X version of Fallout on my MacBook 11", which has a 1366x768 display. There is a [high resolution patch][hi-res], but it only supports the Windows version of Fallout.

Turns out that the OS X version of Fallout runs through Wine, so we can get this patch working with just a few configuration changes:

Note for Fallout 2 users: The process for Fallout 2 is essentially the same, with a different patch, and some minor pathing differences. Other than that, the process is exactly the same!

Install Wine

@blakecrosby
blakecrosby / gist:1731bcddec0897e1c23d
Created December 24, 2014 16:18
Best Traceroute Ever!
[bcrosby@infiniteloop ~]$ traceroute -m255 xmas.futile.net
traceroute to xmas.futile.net (77.75.106.106), 255 hops max, 60 byte packets
1 router2-nac.linode.com (207.99.1.14) 0.460 ms 0.569 ms 0.693 ms
2 207.99.53.45 (207.99.53.45) 0.243 ms 0.254 ms 0.286 ms
3 0.e1-1.tbr2.tl9.nac.net (209.123.10.78) 1.278 ms 1.260 ms 1.351 ms
4 0.e2-2.pr2.tl9.nac.net (209.123.11.146) 1.252 ms 1.331 ms 1.384 ms
5 xe-0-0-0-0.edge00.thn.uk.hso-group.net (195.66.224.226) 79.858 ms 79.847 ms 79.827 ms
6 xe-8-3.core00.thn.uk.hso-group.net (93.89.91.15) 83.115 ms 80.668 ms 80.683 ms
7 xe-4-4.core00.gs1.uk.hso-group.net (77.75.108.160) 88.337 ms 88.427 ms 86.697 ms
8 ae0-1203.edge00.sov.uk.hso-group.net (46.17.60.117) 82.199 ms 82.166 ms 82.122 ms
@lapastillaroja
lapastillaroja / DividerItemDecoration.java
Last active November 17, 2023 23:06 — forked from akmalxxx/DividerItemDecoration.java
DividerItemDecoration. RecyclerView.ItemDecoration simple implementation
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
@FrancoisBlavoet
FrancoisBlavoet / ContextMenuRecyclerView.java
Last active October 26, 2016 23:38
ContextMenuRecyclerView - simple sample on how to adapt an existing ContextMenu to RecyclerView
import android.content.Context;
import android.util.AttributeSet;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.View;
public class ContextMenuRecyclerView extends RecyclerView {