Skip to content

Instantly share code, notes, and snippets.

View SherifMuSherif's full-sized avatar

Sherif Sherif SherifMuSherif

  • Vancouver, BC
View GitHub Profile
@jaconza
jaconza / word_country_data.sql
Created October 24, 2011 15:21
MySQL script for creation and population of country, city and countryLanguage tables with the most popular cities and countries already inserted.
-- MySQL dump 10.13 Distrib 5.1.51, for pc-linux-gnu (i686)
--
-- Host: 127.0.0.1 Database: world
-- ------------------------------------------------------
-- Server version 5.1.51-debug-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
@Integralist
Integralist / remote-git.md
Created February 21, 2012 09:51
Basic set-up of remote git repository on a standard server

Set-up remote git repository on a standard server

The first thing to do is to install Git on the remote server.

Once you do that the rest of the process is split into three sections:

  1. Server set-up
  2. Local set-up (push commits)
  3. Server (pull commits)
@alexfu
alexfu / FragmentObserver.java
Last active June 21, 2024 19:11
Observer pattern for notifying Fragments of a ViewPager to update their views. This will update the current Fragment, as well as the off screen Fragments that are retained.
public class FragmentObserver extends Observable {
@Override
public void notifyObservers() {
setChanged(); // Set the changed flag to true, otherwise observers won't be notified.
super.notifyObservers();
}
}
@jayrambhia
jayrambhia / ButtonObservable.java
Last active October 25, 2017 03:30
Multiple button clicks using RxAndroid
public void setClickObservable(final Button button) {
Subscription subscription = Observable.create(new Observable.OnSubscribe<Integer>() {
@Override
public void call(final Subscriber<? super Integer> subscriber) {
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@mgdiez
mgdiez / RxLocationProvider.java
Last active April 1, 2020 20:29
Reactive Location Provider using new FusedLocationProviderClient
package *;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.IntentSender;
import android.location.Location;
import android.os.Looper;
import android.support.annotation.VisibleForTesting;
import com.google.android.gms.common.api.ApiException;
@dev-niiaddy
dev-niiaddy / QRPainter.kt
Last active July 4, 2024 10:45
A function to encode text as a QR code using BitmapPainter and zxing-core for use in jetpack compose with Image composable.
@Composable
fun rememberQrBitmapPainter(
content: String,
size: Dp = 150.dp,
padding: Dp = 0.dp
): BitmapPainter {
val density = LocalDensity.current
val sizePx = with(density) { size.roundToPx() }
val paddingPx = with(density) { padding.roundToPx() }