Skip to content

Instantly share code, notes, and snippets.

mdeora mdeora

Block or report user

Report or block mdeora

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View TimeUtils.java
package com.example.utils;
import android.annotation.SuppressLint;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
/**
@mdeora
mdeora / RecyclerViewExt.kt
Created Apr 23, 2019 — forked from ricknout/RecyclerViewExt.kt
Change order of args to enable trailing lambda syntax
View RecyclerViewExt.kt
package com.nickrout.snaphelperlistener
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.SnapHelper
fun RecyclerView.attachSnapHelperWithListener(
snapHelper: SnapHelper,
behavior: SnapOnScrollListener.Behavior = SnapOnScrollListener.Behavior.NOTIFY_ON_SCROLL,
onSnapPositionChangeListener: OnSnapPositionChangeListener) {
snapHelper.attachToRecyclerView(this)
@mdeora
mdeora / styles.xml
Created Mar 27, 2019 — forked from mustafasevgi/styles.xml
Android appcompat full screen and hide status bar
View styles.xml
<resources>
<style name="AppTheme" parent="@style/Theme.AppCompat.Light">
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
</resources>
@mdeora
mdeora / copydb_all_tables_mysqli.php
Last active Jun 1, 2018
Copy all tables from one database to another database using php code
View copydb_all_tables_mysqli.php
<?php
$dblink1=mysqli_connect('[server ip1]', '[username]', '[password]'); // connect server 1
mysqli_select_db($dblink1,'[db name]'); // select database 1
$dblink2=mysqli_connect('[server ip2]', '[username]', '[password]'); // connect server 2
mysqli_select_db($dblink2,'[db name]'); // select database 2
$tables = mysqli_fetch_array(mysqli_query($dblink1,"SHOW TABLES "));
@mdeora
mdeora / classifier.php
Created May 14, 2018 — forked from andreiz/classifier.php
A simple example of logistic regression via gradient descent in PHP.
View classifier.php
<?php
error_reporting(E_ALL);
define('NUM_FEATURES', 3);
// My dataset describes cities around the world where I might consider living.
// Each sample (city) consists of 3 features:
// * Feature 1: average low winter temperature in the city
// * Feature 2: city population, in millions
@mdeora
mdeora / classifier.php
Created May 14, 2018 — forked from andreiz/classifier.php
A simple example of logistic regression via gradient descent in PHP.
View classifier.php
<?php
error_reporting(E_ALL);
define('NUM_FEATURES', 3);
// My dataset describes cities around the world where I might consider living.
// Each sample (city) consists of 3 features:
// * Feature 1: average low winter temperature in the city
// * Feature 2: city population, in millions
@mdeora
mdeora / classifier.php
Created May 14, 2018 — forked from andreiz/classifier.php
A simple example of logistic regression via gradient descent in PHP.
View classifier.php
<?php
error_reporting(E_ALL);
define('NUM_FEATURES', 3);
// My dataset describes cities around the world where I might consider living.
// Each sample (city) consists of 3 features:
// * Feature 1: average low winter temperature in the city
// * Feature 2: city population, in millions
@mdeora
mdeora / strpos_array.php
Created Dec 28, 2017 — forked from msng/strpos_array.php
PHP: strpos_array is strpos that can take an array as needle
View strpos_array.php
<?php
function strpos_array($haystack, $needles, $offset = 0) {
if (is_array($needles)) {
foreach ($needles as $needle) {
$pos = strpos_array($haystack, $needle);
if ($pos !== false) {
return $pos;
}
}
return false;
@mdeora
mdeora / strpos_array.php
Created Dec 28, 2017 — forked from msng/strpos_array.php
PHP: strpos_array is strpos that can take an array as needle
View strpos_array.php
<?php
function strpos_array($haystack, $needles, $offset = 0) {
if (is_array($needles)) {
foreach ($needles as $needle) {
$pos = strpos_array($haystack, $needle);
if ($pos !== false) {
return $pos;
}
}
return false;
@mdeora
mdeora / RunAProxyOnAmazonEC2VPC.md
Created Aug 12, 2017 — forked from webinista/RunAProxyOnAmazonEC2VPC.md
Create a proxy server on an Amazon EC2 (VPC) instance
View RunAProxyOnAmazonEC2VPC.md

This will create a proxy server in whatever your availability zone your VPC is in. For me, that's us-east-1b. For you, that may be something different. Steps 10+ should more or less work regardless of your provider since those steps cover the setup and configuration of TinyProxy.

  1. Click the Launch Instance button.
  2. Choose Ubuntu Server 14.04 LTS (HVM), SSD Volume Type. This isn't strictly necessary. If you choose another OS, check its documentation for how to install new packages.
  3. On the Choose an Instance Type screen, select t2.micro. It's Free Tier eligible.
  4. Click the Next: ... buttons until you reach the Configure Security Group screen.
    • You may wish to reduce the amount of storage on the Add Storage screen. This is optional.
    • You may wish to add a tag on the Tag Instance screen. This is also optional.
  5. On the Configure Security Group screen:
    • Select Create a new security group.
You can’t perform that action at this time.