Skip to content

Instantly share code, notes, and snippets.

View maacpiash's full-sized avatar
🕶️
using System.Reflection;

Ahad Chowdhury maacpiash

🕶️
using System.Reflection;
View GitHub Profile
@maacpiash
maacpiash / tsconfig.json
Last active June 11, 2020 13:03
Default typescript configuration
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"allowJs": false, /* Allow javascript files to be compiled. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
"outDir": "./out", /* Redirect output structure to the directory. */
@maacpiash
maacpiash / renameFolders.ts
Last active June 1, 2020 13:51
Rename the folders exported by Sony PlayMemories app to YYYY-MM-DD format
import { readdirSync, renameSync } from 'fs'
const dirName = process.argv[2] ?? './'
// if the path to the folders is not to be specified,
// the script should be run from inside the folder.
readdirSync(dirName, { withFileTypes: true })
.filter(dir => dir.isDirectory())
.map(dir => {
const oldName = dir.name
@maacpiash
maacpiash / upgrade-mui-v0-v4.md
Last active December 6, 2019 08:25
A non-comprehensive guide to upgrading Material-UI from v0 to v4

Upgrading Material-UI from v0 to v4

LeftIcon, RightIcon

- import LeftIcon from 'material-ui/svg-icons/hardware/keyboard-arrow-left';
- import RightIcon from 'material-ui/svg-icons/hardware/keyboard-arrow-right';

+ import { KeyboardArrowLeftIcon, KeyboardArrowRightIcon } from '@material-ui/icons/Keyboard';
using System;
namespace DelegateMath
{
class Program
{
static void Main(string[] args)
{
PrintResult(Multiply, 5, 12);
}
@maacpiash
maacpiash / 90210.theme.bash
Created February 15, 2019 12:45
Bash-It Themes Customized
#!/usr/bin/env bash
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
SCM_THEME_PROMPT_PREFIX=" |"
SCM_THEME_PROMPT_SUFFIX="${green}|"
GIT_THEME_PROMPT_DIRTY=" ${red}✗"
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓"
GIT_THEME_PROMPT_PREFIX=" ${green}|"
GIT_THEME_PROMPT_SUFFIX="${green}|"
@maacpiash
maacpiash / Program.cs
Created February 6, 2019 11:03
Testing Delegates
using System;
namespace DelegateTesting
{
class Program
{
public static void Main(string[] args)
{
SaySomething s = SayHello;
Print(s);
@maacpiash
maacpiash / RefTest.cs
Created July 20, 2018 12:13
Testing different types of pass-by/return types: value vs reference
using System;
using static System.Console;
namespace RefTest
{
class Program
{
static void Main(string[] args)
{
ValVal(); // Returns value, pass by value
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ExcelDataReader" Version="3.4.0" />
<PackageReference Include="ExcelDataReader.DataSet" Version="3.4.0" />
@maacpiash
maacpiash / ListShuffler.csproj
Last active April 24, 2018 18:16
A program to shuffle the lines of a text file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
</Project>