Skip to content

Instantly share code, notes, and snippets.

View sakibguy's full-sized avatar
🎯
p.java

sakibguy

🎯
p.java
View GitHub Profile
@sakibguy
sakibguy / README.md
Created December 16, 2017 07:30 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

#include <stdio.h>
#define SUM(x, y) (x + y)
int main(int argc, char *argv[])
{
int a = 5;
int b = 10;
int sum = SUM(a, b);
printf("%d\n", sum);
/* Preprocessed code omitted */
int main(int argc, char *argv[])
{
int a = 5;
int b = 10;
int sum = (a + b);
printf("%d\n", sum);
}
#include <stdio.h>
void bar()
{
int var = 10;
printf("var in bar: %d\n", var);
}
void foo()
{
#include <stdio.h>
#define bar() \
int var = 10;\
printf("var in bar: %d\n", var)
void foo()
{
int var = 5;
printf("var in foo: %d\n", var);
#include <iostream>
using namespace std;
void printError(int errorCode, string msg = "No message")
{
cerr << "Error code: " << errorCode << " (" << msg << ")\n";
}
int main(int argc, char *argv[])
#include <stdio.h>
#define printErrord(errorCode) printError(errorCode, "No message")
void printError(int errorCode, char *msg)
{
printf("Error code: %d (%s)\n", errorCode, msg);
}
int main(int argc, char *argv[])
#ifndef MACROS_IN_C_H
#define MACROS_IN_C_H
/* Function prototypes */
#endif // MACROS_IN_C_H
@sakibguy
sakibguy / Android.mk
Created April 11, 2021 12:12 — forked from BoldBigflank/Android.mk
android/jni/
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := game_shared
LOCAL_MODULE_FILENAME := libgame
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
@sakibguy
sakibguy / encodeCredentials.html
Created October 4, 2021 11:55 — forked from zapalote/encodeCredentials.html
Credential obfuscation and encryption to store then on a database
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/crypto-js.min.js"></script>
<script>
// used to obfuscate and encrypt the credentials
const saltCredentials = "jf02heg9u64a{%m<83#@;Pxrjg17uyr#@&*%^Y";
// encode credentials before storing
function encodeCredentials(crds){
// json object expected e.g. {'api-id':'K0xf56g', 'pwd':'Some.Pa$$w0rd'}
const crd = JSON.stringify(crds);