Skip to content

Instantly share code, notes, and snippets.

View torifat's full-sized avatar
🇸🇩
Why do we even have this here?

Rifat Nabi torifat

🇸🇩
Why do we even have this here?
View GitHub Profile
@torifat
torifat / Person.java
Created October 31, 2014 23:14
Java Person Class
public class Person implements Serializable {
private final String firstName;
private final String lastName;
public Person(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
public String getFirstName() {
@torifat
torifat / callback.html
Last active June 19, 2020 18:02
Enable Avro Phonetic in all textboxes & textareas with a callback function
<script src="path/to/avro-x.x.x.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function(){
$('textarea, input[type=text]').avro({'bangla':true},
function(isBangla){
alert('Bangla enabled = ' + isBangla);
}
);
});
</script>
@torifat
torifat / machine.js
Created May 13, 2020 02:48
Generated by XState Viz: https://xstate.js.org/viz
const extensionMachine = Machine({
id: 'extension',
initial: 'loading',
context: {
retries: 0
},
states: {
loading: {
on: {
LOAD_MANIFEST: 'manifestOnly',
@torifat
torifat / .flowconfig
Created August 4, 2016 01:43
Default .flowconfig for create-react-app
[libs]
./node_modules/fbjs/flow/lib
[options]
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
module.name_mapper='^\(.*\)\.css$' -> 'react-scripts/config/flow/css'
module.name_mapper='^\(.*\)\.\(jpg\|png\|gif\|eot\|svg\|ttf\|woff\|woff2\|mp4\|webm\)$' -> 'react-scripts/config/flow/file'
@torifat
torifat / .bashrc
Created September 30, 2011 18:21
My Bashrc
## If not running interactively, don't do anything
[ -z "$PS1" ] && return
export EDITOR='mate'
export GIT_EDITOR='mate -wl1'
## History control
# Control how bash stores command history
# flags: ignorespace, ignoredups, ignoreboth
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
document.addEventListener('paste', e => {
@torifat
torifat / __helpers.js
Created December 5, 2016 21:09
Jest toMatchObject
// @flow
const {
EXPECTED_COLOR,
RECEIVED_COLOR,
matcherHint,
printReceived,
printExpected,
printWithType
} = require('jest-matcher-utils');
@torifat
torifat / pr.md
Created December 18, 2016 21:26 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@torifat
torifat / php-switch
Created July 30, 2012 18:11
a php switching utillity for homebrew
#!/bin/bash
# php switch for homebrew
# $ brew tap josegonzalez/php && brew install php53 --with-mysql && brew install php54 --with-mysql
# Might as well ask for password up-front, right?
sudo -v
VERSION_FILE="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/php-switch.version"
@torifat
torifat / xterm-256color.svg
Created September 22, 2016 09:54 — forked from jasonm23/xterm-256color.svg
Xterm 256color mode color chart, organised into sections.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.