Skip to content

Instantly share code, notes, and snippets.

View beshkenadze's full-sized avatar

Aleksandr Beshkenadze beshkenadze

View GitHub Profile
@beshkenadze
beshkenadze / wsl-port-forwarding.md
Last active April 19, 2023 18:54 — forked from estsaon/wsl-port-forwarding.md
How to SSH into WSL2 on an external Window

WSL:

  1. Install openssh-server:
sudo apt install openssh-server
  1. Add or uncomment following lines in /etc/ssh/sshd_config:
@beshkenadze
beshkenadze / du.sh
Last active September 9, 2022 09:22 — forked from tsh-code/du.sh
Find largest modules / Check a docker image size
#/bin/sh
du -sh ./node_modules/* | sort -nr | grep '\dM.*'
issue tracking:
* redmine (see also: chili project)
* jira
* youtrack
* fogbugz
* trac
* bugzilla
* pivotal tracker
* mantis
@beshkenadze
beshkenadze / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// ============================================================================================
// Code
//
// Example showing how to set a View's background to a tiled bitmap.
// assumes: res/drawable/pattern01.png - The bitmap representing an individual tile
public void setViewTiledBackground(View view, Resources resources) {
Bitmap tile = BitmapFactory.decodeResource(resources, R.drawable.pattern02);
BitmapDrawable tiledBitmapDrawable = new BitmapDrawable(resources, tile);
tiledBitmapDrawable.setTileModeX(Shader.TileMode.REPEAT);

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ImageSpan;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.SearchView;
import android.widget.TextView;
import android.app.Activity;
import android.content.Context;
import android.hardware.display.DisplayManager;
import android.os.Bundle;
import android.view.Display;
/**
* A base activity for watch faces that have callbacks for the various screen states (dim, awake, and off)
* as well as a callback for when the watch face is removed.
* <p/>
<script type=3D"application/ld+json">
{
"action": {
"url": "https://www.dropbox.com/invite?k=3DiZfxq5WwbyhujKJcmTocBE8ouwjT7zKr"
"name": "View folder"
"@type": "ViewAction"
}
"@context": "http://schema.org"
"@type": "EmailMessage"
"description": "shared folder invitation"
package com.cyrilmottier.android.citybikes.provider;
import android.net.Uri;
import com.cyrilmottier.android.avelov.BuildConfig;
/**
* @author Cyril Mottier
*/
public class CityBikesContract {