Skip to content

Instantly share code, notes, and snippets.

View manniru's full-sized avatar

MUHAMMAD MANNIR AHMAD manniru

View GitHub Profile
@manniru
manniru / android-generate-keystores.md
Created April 16, 2022 10:17 — forked from henriquemenezes/android-generate-keystores.md
Android: Generate Release/Debug Keystores

Android: Generate Release/Debug Keystores

Generate Keystores

Debug Keystore

$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug"
@manniru
manniru / stream_to_youtube.sh
Created March 31, 2022 17:31 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@manniru
manniru / mongo-conn.ts
Created March 13, 2022 16:57 — forked from renato1010/mongo-conn.ts
Node + Typescript MongoDB connection using Node driver instead of Mongoose
import { Collection, Db, Document, MongoClient } from "mongodb";
// get environment variables for database uri and database name
let uri = process.env.MONGODB_URI;
let dbName = process.env.MONGODB_DB;
// create cache variables so we can cache our connection
let cachedClient: MongoClient | null = null;
let cachedDb: Db | null = null;
#!/bin/sh
# shellcheck disable=SC2086
# nekomimi-daimao
# *MIT* https://opensource.org/licenses/mit-license.php
# https://gist.github.com/nekomimi-daimao/9e4a8ff0e68818574f971a7ff86a536a
# create license file
# docker run --rm -v license:/license -w /license unityci/editor:ubuntu-2019.4.24f1-android-0.12.0 /opt/unity/Editor/Unity -quit -batchmode -nographics -logFile -createManualActivationFile
@manniru
manniru / typescript-crash.ts
Created February 27, 2022 12:29 — forked from bradtraversy/typescript-crash.ts
Basic intro to TypeScript (From YouTube Crash Course)
// Basic Types
let id: number = 5
let company: string = 'Traversy Media'
let isPublished: boolean = true
let x: any = 'Hello'
let ids: number[] = [1, 2, 3, 4, 5]
let arr: any[] = [1, true, 'Hello']
// Tuple
@manniru
manniru / curl.md
Created February 27, 2022 11:32 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@manniru
manniru / Sample.kt
Created February 14, 2022 12:09 — forked from prosperoking/Sample.kt
A sample horizonPay smart Link implementation
class SampleActivity {
private var hasPerformedKeyExchange: Boolean = false
private var iSmartLinkService: ISmartLinkService? = null
private var requestEntity: TransactionRequestEntity? = null
private var resultEntity: TransactionResultEntity? = null
override fun Init() {
bindService()
@manniru
manniru / gist:bebdb638ee412b43db4ffc2efb4b2f7f
Created February 14, 2022 07:02 — forked from nickdominguez/gist:5279351
Clean URLs with Apache 2 on Ubuntu
First, from the Linux command line, enable the rewrite module for apache with this command:
sudo a2enmod rewrite
You can check to see if this worked by running:
sudo apache2ctl -M
and seeing if rewrite_module is on the list.
@manniru
manniru / erc20token.sol
Created February 13, 2022 08:36 — forked from victorleejw/erc20token.sol
Erc20 Smart Contract for a Standard, Capped, Mintable, Burnable, Payable Token.
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/GSN/Context.sol
// https://ropsten.etherscan.io/address/0x8df55a60a1c98281a60d6c89f59398bee854fbc8#code
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
@manniru
manniru / String to Float.php
Created February 9, 2022 21:45 — forked from tristar500/String to Float.php
Convert string value with commas into a float
$val = "1,234,988.56";
$num = floatval(str_replace(",","",$val));
echo $num;
// returns - 1234988.56