Skip to content

Instantly share code, notes, and snippets.

View nqmgaming's full-sized avatar
:shipit:
Focusing

Nguyễn Quang Minh (NQM) nqmgaming

:shipit:
Focusing
View GitHub Profile
@stevdza-san
stevdza-san / Converters.kt
Last active March 31, 2024 10:09
@TypeConverter
class Converters {
@TypeConverter
fun fromBitmap(bitmap: Bitmap): ByteArray {
val outputStream = ByteArrayOutputStream()
bitmap.compress(Bitmap.CompressFormat.PNG, 100, outputStream)
return outputStream.toByteArray()
}
@TypeConverter
/local.properties
@loftywaif002
loftywaif002 / api_keys_android.md
Last active June 4, 2024 13:03
Hiding Api Keys in Anroid

Hiding API keys in local.properties

  1. Make sure your build directory is gitignored. It should be, by default, in a new Android Studio project -- you can double check by making sure that your .gitignore file contains the line:
/build
  1. In your project root directory, add the API key to local.properties file like this:
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
WindowCompat.setDecorFitsSystemWindows(window, false)
super.onCreate(savedInstanceState)
setContent {
ColorPickerTheme {
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
@RustemAqtau
RustemAqtau / UIView+Extension.swift
Last active June 26, 2024 10:23
UIView Extension for configure constraints anchors programmatically
import UIKit
extension UIView {
func anchor(top: NSLayoutYAxisAnchor? = nil,
left: NSLayoutXAxisAnchor? = nil,
bottom: NSLayoutYAxisAnchor? = nil,
right: NSLayoutXAxisAnchor? = nil,
paddingTop: CGFloat = 0,
paddingLeft: CGFloat = 0,
paddingBottom: CGFloat = 0,
@jmfdz
jmfdz / UIIMageViewExtensions.swift
Created November 27, 2016 09:38
Swift Extension for iOS: Load image from URL and put In UIImageView
import Foundation
import UIKit
extension UIImageView {
func downloadedFrom(url: URL, contentMode mode: UIViewContentMode = .scaleAspectFit) {
contentMode = mode
URLSession.shared.dataTask(with: url) { (data, response, error) in
guard
let httpURLResponse = response as? HTTPURLResponse, httpURLResponse.statusCode == 200,
let mimeType = response?.mimeType, mimeType.hasPrefix("image"),
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class RocketStages {
static final int N = 11000;
static final double G = 9.8;
static double A[] = new double[N + 100];
@Justryuz
Justryuz / gist:0c42b0db0da87318a13c894079fd4437
Last active July 26, 2024 01:53
## Unlimited User License Sublime Text Windows Build 4107
## Unlimited User License Sublime Text Alpha 4107 Windows
Download & Install Sublime Text 4 Alpha 4107
Visit https://hexed.it/
Open file select sublime_text.exe
Go to Address: 80 38 00 and Change to FE 00 90
Export File and save it to location you want
Backup sublime_text.exe file (just rename)
Copy sublime_text.exe modified to directory Sublime Text 4 (i.e C:\Program Files\Sublime Text)
@ubogdan
ubogdan / ida_plugins.md
Created August 11, 2019 09:03
A list of IDA Plugins

A list of IDA Plugins

I'll be organizing the plugins over time. Please submit PRs if you have any other outstanding plugins. I would like to tag each plugin with its corresponding IDA version, but it will take me a long time to test. If you can help there, please do.

If a plugin is only a source repo with no description or documentation, I am not adding it.

TODO

  • Add more plugins
  • Categorize plugins
@wjmazza
wjmazza / google-sheets-colour-preview.js
Last active October 6, 2024 22:51 — forked from Pathoschild/google-sheets-color-preview.js
A Google Sheets script which adds colour preview to cells. When you edit a cell containing a valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to that colour and the font colour will be changed to the inverse colour for readability.
/*
This script is meant to be used with a Google Sheets spreadsheet. When you edit a cell containing a
valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to
that colour and the font colour will be changed to the inverse colour for readability.
To use this script in a Google Sheets spreadsheet:
1. go to Tools » Script Editor » Spreadsheet;
2. erase everything in the text editor;
3. change the title to "Set colour preview on edit";