Skip to content

Instantly share code, notes, and snippets.

View diegoperini's full-sized avatar
🎹
Focusing

Diego Perini diegoperini

🎹
Focusing
View GitHub Profile
@diegoperini
diegoperini / svg2png.sh
Last active August 29, 2015 14:07
Shell script to batch render svg files to png for mobile use
mogrify -alpha On -background none -density 2000 -resize $1 -format png *.svg
# Usage: sh svg2png.sh <dimensions>
#
# <dimensions> can be any geometry value described here (copied from ImageMagick site):
#
# scale% Height and width both scaled by specified percentage.
# scale-x%xscale-y% Height and width individually scaled by specified percentages. (Only one % symbol needed.)
# width Width given, height automagically selected to preserve aspect ratio.
# xheight Height given, width automagically selected to preserve aspect ratio.
@diegoperini
diegoperini / countries.csv
Created January 29, 2015 19:04
155 Countries with phone codes, ready for import as csv
1 Albania +355 Europe
2 Algeria +213 Africa
3 Angola +244 Africa
4 Anguilla +1264 North America
5 Antigua and Barbuda +1268 North America
6 Argentina +54 South America
7 Armenia +374 Europe
8 Australia +61 Oceanica
9 Austria +61 Europe
10 Azerbaijan +994 Europe
@diegoperini
diegoperini / count-lines.sh
Created November 17, 2015 00:07
count-lines
#!/bin/sh
#
# Simple shell script to count number of lines in every
# file with given file extension in current directory.
#
# Usage:
# ./count-lines.sh 'js'
# ./count-lines.sh 'cpp'
find . -name '*.'$1 | xargs wc -l
@diegoperini
diegoperini / ListViewScrollTracker.java
Created February 25, 2016 12:23 — forked from cnnrhill/ListViewScrollTracker.java
Helper class for calculating relative scroll offsets in a ListView or GridView by tracking the position of child views.
import android.util.SparseArray;
import android.widget.AbsListView;
/**
* Helper class for calculating relative scroll offsets in a ListView or GridView by tracking the
* position of child views.
*/
public class ListViewScrollTracker {
private AbsListView mListView;
private SparseArray<Integer> mPositions;
# This is my personal Atom editor profile
@diegoperini
diegoperini / TouchProxyView.swift
Last active March 4, 2019 16:02
A parent view to redirect touch events to its first child, can be used to extend scrollable area of a small UIScrollView
// Make sure you disable user interractions on the first child of this view
class TouchProxyView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}

Telefon Güvenliği

Mevcut cep telefonunuzdaki uzaktan erişim ve takip özelliklerini tamamen kapatabilmek için uygulamanız gereken adımlar aşağıdaki gibidir. Telefonunuzun markasına göre size uyan başlıktaki talimatlara uyabilirsiniz. Bu talimatları uygulamaya başlamadan önce cihazın şarj seviyesini en az %50'ye getirmeniz, telefon dilini Türkçe'ye geçirmeniz ve rehber, fotoğraflar gibi kişisel bilgilerin bir yedeğini almanız tavsiye edilir. Bu yedekleri akıllı telefon uygulamaları ile değil, manuel yollarla (bir kağıda yazmak, USB kablo ile bilgisayara aktarmak gibi) yapmanız daha uygundur.

Tüm Cihazlar İçin Talimatlar

  1. Mümkünse eposta adresinizi terkedin.
  2. Eposta adresini terkedemiyorsanız önce internet üzerinden eposta hizmetinize giriş yapın.
  3. Hizmet sağlayıcınızın güvenlik ayarlarına ilerleyin.
  4. Varsa, daha önceden tanımlı bütün şifre kurtarma (recovery) adreslerini silin.
  5. Varsa, daha önceden tanımlı bütün şifre kurtarma (recovery) telefon numaralarını silin.
  6. Şifrenizi değiştirin.
@diegoperini
diegoperini / test_ciphers.bash
Created January 22, 2020 22:33
How to get supported ciphers list from an endpoint
#!/usr/bin/env bash
# Source: https://superuser.com/a/224263
# Usage: bash test_ciphers.bash example.com:443
# OpenSSL requires the port number.
SERVER=$1
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
@diegoperini
diegoperini / flutter-20-tf-update.md
Created November 3, 2020 11:00
Dart 2 update guide for TestFairy

To be able to use TestFairy Flutter Plugin 2.+, you must have the environment specified below and upgrade your project code base to Dart 2 using this guide.

environment:
  sdk: ">=2.10.0 <3.0.0"
  flutter: ">=1.22.0 <2.0.0"

Make sure your project root has an analysis_options.yaml that looks similar to this. The important part is the enabled experiment in the top declaration.

@diegoperini
diegoperini / is-running-in-docker.bash
Created November 3, 2020 15:06
Bash command to check if running in a Docker container
(cat /proc/1/cgroup | grep -m 1 docker > /dev/null && echo docker) || echo baremetal