Skip to content

Instantly share code, notes, and snippets.

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

Rasheed Rahman radiumrasheed

🏠
Working from home
View GitHub Profile
@radiumrasheed
radiumrasheed / BitbucketPipelines2Firebase.md
Created October 1, 2018 11:51 — forked from DawidvanGraan/BitbucketPipelines2Firebase.md
Deploy your Angular 2 project with Bitbucket Pipelines to Firebase Hosting

Deploy your Angular 2 project with Bitbucket Pipelines to Firebase Hosting

Firebase

Please see the Firebase setup instruction to setup a project on Firebase.

Firebase CI Token

To run the firebase deploy command you need to obtain a login token from Firebase. To do so, run the firebase login:ci on your command line which will generate a token. Copy the generated token.

Environment Variables

Goto your project in Bitbucket, open the Settings and select Environment variables.

<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
@radiumrasheed
radiumrasheed / file-size.pipe.ts
Created March 20, 2018 01:15 — forked from JonCatmull/file-size.pipe.ts
Angular2 + TypeScript file size Pipe/Filter. Convert bytes into largest possible unit. e.g. 1024 => 1 KB
import { Pipe, PipeTransform } from '@angular/core';
/*
* Convert bytes into largest possible unit.
* Takes an precision argument that defaults to 2.
* Usage:
* bytes | fileSize:precision
* Example:
* {{ 1024 | fileSize}}
* formats to: 1 KB
@radiumrasheed
radiumrasheed / gist:93cf887f6693658eb0b1d612ccbfcd34
Created October 3, 2017 08:54 — forked from resting/gist:3421760
AES128 encrypt/decrypt in PHP with base64
<?
function aes128Encrypt($key, $data) {
if(16 !== strlen($key)) $key = hash('MD5', $key, true);
$padding = 16 - (strlen($data) % 16);
$data .= str_repeat(chr($padding), $padding);
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_CBC, str_repeat("\0", 16)));
}
function aes128Decrypt($key, $data) {
@radiumrasheed
radiumrasheed / .env.travis
Created June 11, 2017 23:40 — forked from gilbitron/.env.travis
Laravel 5 Travis CI config
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
@radiumrasheed
radiumrasheed / naira-amount-in-words.php
Created March 21, 2017 14:40
Collection of Functions to convert a Money Figure to Amount in Words (Currency - Naira and Kobo)
/**
* Amount in Words(Naira) Converter - Collection of PHP functions
* to convert a given Number into Naira Amount in Words
*
*/
function convertNumber($number) {
list($integer, $fraction) = explode(".", (string)$number);
$output = "";