Skip to content

Instantly share code, notes, and snippets.

View Gnzlt's full-sized avatar

Gonzalo Toledano Gnzlt

View GitHub Profile

DevEGOpers

Llevo unos años trabajando en empresas del sector tecnológico, me dedico al desarrollo de software y creedme cuando os digo que he visto de todo. Empresas, grandes, empresas pequeñas, auto financiadas, con inversión externa, con equipos técnicos brillantes y equipos técnicos como los que puedes encontrar en cualquier otro lugar. Al igual que empresas de todos los colores también he tenido el placer de conocer a todo tipo de programadores y es ahora que ya han pasado unos cuantos años cuando puedo reconocer una serie de patrones que he visto tanto en mi mismo como en la gente que me rodea. En este gist/post voy a intentar plasmar algunos de estos patrones que he me resultan cuanto menos curiosos.

En este post me centraré en los desarrolladores de software porque es el gremio en el que me encuentro, pero seguro que aunque no te dediques a esto podrás encontrar similitudes con tu profesión. Estos son los patrones con los que yo me he econtrado en diferentes empresas y que he podido ver en mi mismo

public class ExampleActivity extends AppCompatActivity implements OnMapReadyCallback {
private MapViewObserver mapView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_estimate);
MapView view = findViewById(R.id.map_view);
mapView = new MapViewObserver(getLifecycle(), view, this);
class SingleViewTouchableMotionLayout(context: Context, attributeSet: AttributeSet? = null) :
MotionLayout(context, attributeSet) {
private val viewToDetectTouch by lazy {
if (resourceId != -1)
return@lazy findViewById<View>(resourceId)
else
return@lazy null
}
private val viewRect = Rect()
@XueshiQiao
XueshiQiao / gource.sh
Last active November 10, 2019 15:56 — forked from cgoldberg/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
@luciofm
luciofm / ChatRoomsFragment.kt
Last active June 13, 2020 14:33
How to run LiveData transformations on a coroutine
class ChatRoomsFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
viewModel = ViewModelProviders.of(this, factory).get(ChatRoomsViewModel::class.java)
subscribeUi()
}
private fun subscribeUi() {
@jishindev
jishindev / AwsDataFetcher.kt
Created July 2, 2019 06:30
Data fetcher that can be registered with a Glide module to load data from AWS S3 Storage
class AwsDataFetcher(private val s3Client: AmazonS3Client, private val awsImage: AwsImage) : DataFetcher<InputStream> {
override fun getDataClass() = InputStream::class.java
override fun loadData(priority: Priority, callback: DataFetcher.DataCallback<in InputStream>) {
callback.onDataReady(
s3Client.getObject(
GetObjectRequest(
awsImage.bucket,
@brndnblck
brndnblck / GPG and git on macOS.md
Created April 6, 2017 05:02 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@pedrovgs
pedrovgs / android_start_bitrise_emulator.sh
Last active August 15, 2021 10:04
A ready to work emulator for Bitrise.io
#!/usr/bin/env bash
set -e
build_dir=$(pwd)
echo "Curren build dir:"
echo $build_dir
cd $ANDROID_HOME/emulator
echo "Creating sdcard image"
@lgvalle
lgvalle / firebase-scraping.js
Last active September 23, 2021 01:17
Firebase cloud function to scrap html and send the content with push notifications
const rp = require('request-promise');
const cheerio = require('cheerio');
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
const db = admin.firestore();
exports.allyPallyFarmersMarket = functions.https.onRequest((request, response) => {
@Anton111111
Anton111111 / transparent_statusbar.java
Created February 4, 2019 12:45
Transparent statusbar
/**
* need call setFitsSystemWindows(false) on view that need it
*
* @param activity
*/
public static void setStatusBarTransparent(@NonNull Activity activity) {
if (Build.VERSION.SDK_INT >= 19 && Build.VERSION.SDK_INT < 21) {
setWindowFlag(activity, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, true);
}
if (Build.VERSION.SDK_INT >= 19) {