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
@srsandy
srsandy / ColumnFilter.js
Last active January 11, 2024 06:54
React Table Server side Pagination and Filtering
import "regenerator-runtime/runtime";
import { useState } from "react";
import { useAsyncDebounce } from "react-table";
const ColumnFilter = ({ column }) => {
const { filterValue, setFilter } = column;
const [value, setValue] = useState(filterValue);
const onChange = useAsyncDebounce((value) => {
setFilter(value || undefined);
}, 300);
@l-wagner
l-wagner / DynamicDropdownExcel.js
Created October 24, 2020 16:10
Using ExcelJs to create sheet with dynamic dropdown options
import FileSaver from 'file-saver';
import Excel from 'exceljs';
/* Export excel file with dynamic dropdowns
All hope abandon, ye who enter here.
Data argument looks like
{
columns: [ { col1Def }, { col2Def } ],
rows: [ { columnDataField: value, columnDataField: value } ]
fileName: 'Name'
@radiumrasheed
radiumrasheed / logger.js
Created August 14, 2019 08:54
Integrate Winston Logger in Node Express App
'use strict';
const NODE_ENV = process.env.NODE_ENV || 'development';
const CloudWatchTransport = require('winston-aws-cloudwatch');
const Winston = require('winston');
let transport;
if (NODE_ENV === 'development') {
transport = new Winston.transports.Console({
format: Winston.format.combine(
@mfd
mfd / GTWalsheimPro.css
Last active May 3, 2024 16:52
GT Walsheim Pro
@font-face {
font-family: GT Walsheim Pro;
src: local("GT Walsheim Pro Regular"),local("GTWalsheimProRegular"),url(GTWalsheimProRegular.woff2) format("woff2"),url(GTWalsheimProRegular.woff) format("woff"),url(GTWalsheimProRegular.ttf) format("truetype");
font-weight: 400;
font-style: normal
}
@font-face {
font-family: GT Walsheim Pro;
src: local("GT Walsheim Pro Bold"),local("GTWalsheimProBold"),url(GTWalsheimProBold.woff2) format("woff2"),url(GTWalsheimProBold.woff) format("woff"),url(GTWalsheimProBold.ttf) format("truetype");
@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 = "";
@larikraun
larikraun / Nigerian States
Created March 9, 2017 04:31
This is a list of Nigerian states as a string array in Android
<string-array name="states">
<item>Abia State</item>
<item>Adamawa State</item>
<item>Akwa Ibom State</item>
<item>Anambra State</item>
<item>Bauchi State</item>
<item>Bayelsa State</item>
<item>Benue State</item>
<item>Borno State</item>
<item>Cross River State</item>
@JonCatmull
JonCatmull / file-size.pipe.ts
Last active April 14, 2024 14:27
Angular2 + TypeScript file size Pipe/Filter. Convert bytes into largest possible unit. e.g. 1024 => 1 KB
/**
* @license
* Copyright (c) 2019 Jonathan Catmull.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
FFmpeg has been removed from Ubuntu 14.04 and was replaced by Libav. This decision has been reversed so that FFmpeg is available now in Ubuntu 15.04 again, but there is still no official package for 14.04. In this tutorial, I will show you how to install FFmpeg from mc3man ppa. Add the mc3man ppa:
sudo add-apt-repository ppa:mc3man/trusty-media
And confirm the following message by pressing <enter>:
Also note that with apt-get a sudo apt-get dist-upgrade is needed for initial setup & with some package upgrades
More info: https://launchpad.net/~mc3man/+archive/ubuntu/trusty-media
Press [ENTER] to continue or ctrl-c to cancel adding it
Update the package list.
@gilbitron
gilbitron / .env.travis
Last active August 12, 2023 08:06
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
@cmmartin
cmmartin / moment-filter.js
Last active July 31, 2019 09:01
A generic Moment.js date filter for Angular.js
// REQUIRES:
// moment.js - http://momentjs.com/
// USAGE:
// {{ someDate | moment: [any moment function] : [param1] : [param2] : [param n]
// EXAMPLES:
// {{ someDate | moment: 'format': 'MMM DD, YYYY' }}
// {{ someDate | moment: 'fromNow' }}