Skip to content

Instantly share code, notes, and snippets.

View nggepe's full-sized avatar
▶️
Play the code

Gilang Pratama nggepe

▶️
Play the code
View GitHub Profile
void main() {
var num1 = 40;
var num2 = 5;
print("AND\n");
print(num1 & num2);
print("OR\n");
print(num1 | num2);
print("XOR\n");
@nggepe
nggepe / aes-256-cbc.js
Created March 16, 2021 18:30 — forked from siwalikm/aes-256-cbc.js
AES-256-CBC implementation in nodeJS with built-in Crypto library
'use strict';
const crypto = require('crypto');
const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; // set random encryption key
const IV = "5183666c72eec9e4"; // set random initialisation vector
// ENC_KEY and IV can be generated as crypto.randomBytes(32).toString('hex');
const phrase = "who let the dogs out";
var encrypt = ((val) => {
@nggepe
nggepe / theme_configuration.dart
Created November 23, 2020 06:22
Theme Configuration
import 'package:flutter/material.dart';
import 'package:theme_tutorial/theme_controller.dart';
class ThemeConfiguration {
///github @nggepe | Theme configuration
///```themeController``` merupakan Object ```ThemeController```. tekan
///```ctrl+click``` dan mengedit tema aplikasi anda pada kode dibawah bedasarkan kebutuhan anda
static ThemeData switcher(ThemeController themeController) {
switch (themeController.currentTheme) {
case "dark":
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
class ThemeController extends ChangeNotifier {
static const themePrefKey = 'theme';
/// menampilkan tema default anda
ThemeController(this._prefs) {
// mengambil tema untuk inisialisasi shared preferences
_currentTheme = _prefs.getString(themePrefKey) ?? 'light';