Skip to content

Instantly share code, notes, and snippets.

View daemswibowo's full-sized avatar
🏠
Working from home

Dimas Wibowo daemswibowo

🏠
Working from home
View GitHub Profile
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@daemswibowo
daemswibowo / app - build.gradle
Last active May 22, 2019 10:59
My React Native Initial Setup for Every Projects
// android/app/build.gradle
android {
...
defaultConfig {
...
versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
}
// setup keystore for release
@daemswibowo
daemswibowo / Invoice.php
Last active October 1, 2019 04:19
Group Count Invoices
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Invoice extends Model
{
public function bulan ()
{
-- first, we need to grant user to access qateam role
GRANT qateam TO tester@'%';
-- then we assign it
SET ROLE qateam;
-- check if role access already granted to related user
SHOW GRANTS for tester@'%';
-- Creating a new role
CREATE OR REPLACE ROLE qateam;
-- getting a list of roles
SELECT * FROM information_schema.APPLICABLE_ROLES;
-- grant permissions to the role
GRANT SELECT,INSERT,UPDATE,DELETE ON my_db_name.* TO qateam;
@daemswibowo
daemswibowo / generate-env.sh
Last active July 4, 2022 15:50
Bash generate .env file from vault
if [ -z "$TOKEN" ]; then
echo "Token not provided!"
else
if [ -z "$API_URL" ]; then
echo "Missing the API url, I don't know where the env is :/"
else
echo "Getting environment variable from $API_URL"
if [ -z "$OUTPUT" ]; then
# set default output name
require('dotenv').config()
const express = require('express')
const fetch = require('node-fetch')
const app = express()
app.use('/', async (req, res) => {
// Attachment URL
const attachmentURL = "https://trello.com/1/cards/5e65954f0f343116e999658f/attachments/5e67a146876719748d64057b/previews/5e67a147876719748d6405ae/download"
@daemswibowo
daemswibowo / laravel_encryption.py
Created March 30, 2023 18:13
Python laravel encryption
from Crypto import Random
from Crypto.Cipher import AES
import base64
import json
from phpserialize import unserialize, dumps
import hmac
import hashlib
class LaravelEncryption: