Skip to content

Instantly share code, notes, and snippets.

@mdeora
mdeora / copydb_all_tables_mysqli.php
Last active June 1, 2018 20:07
Copy all tables from one database to another database using php code
<?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 / styles.xml
Created March 27, 2019 11:44 — forked from mustafasevgi/styles.xml
Android appcompat full screen and hide status bar
<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 / RecyclerViewExt.kt
Created April 23, 2019 15:53 — forked from ricknout/RecyclerViewExt.kt
Change order of args to enable trailing lambda syntax
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)
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 / gist:1adcd0ad289f15a5c3f340dcf36e1c86
Created June 20, 2020 18:02 — forked from JoeyBodnar/gist:7be323b066058667851b
Video Loading/Caching with AVAssetResourceLoader
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
VideoCell *videoCell = (VideoCell *)[self.tableView dequeueReusableCellWithIdentifier:@"VideoCell"];
NSString *urlString = @"streaming://download.wavetlan.com/SVV/Media/HTTP/MOV/ConvertedFiles/MediaCoder/MediaCoder_test11_36s_H263_VBR_590kbps_176x144_25fps_MPEG1Layer3_CBR_160kbps_Stereo_22050Hz.mov";
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
// Configure Video Cell Here:
NSURL *url = [NSURL URLWithString:urlString];
videoCell.contentView.backgroundColor = [UIColor clearColor];
videoCell.backgroundColor = [UIColor clearColor];
@mdeora
mdeora / Activate Office 2019 for macOS VoL.md
Created July 12, 2020 09:17 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@mdeora
mdeora / 01-domains.md
Created October 12, 2020 17:18 — forked from captn3m0/01-domains.md
List of all Government of India domains

gov.in (7259)

  • aavin.tn.gov.in
  • abnhpm.gov.in
  • agnii.gov.in
  • ap.gov.in
  • aponline.gov.in
  • appolice.gov.in
  • attendance.gov.in
  • cgg.gov.in
  • eccs.gov.in
@mdeora
mdeora / 01-domains.md
Created October 12, 2020 17:18 — forked from captn3m0/01-domains.md
List of all Government of India domains

gov.in (7259)

  • aavin.tn.gov.in
  • abnhpm.gov.in
  • agnii.gov.in
  • ap.gov.in
  • aponline.gov.in
  • appolice.gov.in
  • attendance.gov.in
  • cgg.gov.in
  • eccs.gov.in
@mdeora
mdeora / Dockerfile
Created September 25, 2022 06:50 — forked from wnqueiroz/Dockerfile
An efficient Dockerfile to build an image with NestJS with just the production dependencies
FROM node:16.17-alpine as builder
WORKDIR /usr/src/app
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
COPY package*.json ./
RUN npm i -g @nestjs/cli \