Skip to content

Instantly share code, notes, and snippets.

View adisesha's full-sized avatar
🎯
Focusing

Adi adisesha

🎯
Focusing
View GitHub Profile
@adisesha
adisesha / docker commands.txt
Last active October 5, 2022 15:27
Docker Commands
## Run Postgres
docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=password -d postgres
@adisesha
adisesha / git.txt
Last active October 5, 2022 15:28
Git Commands
$ git config credential.helper cache
$ git push http://example.com/repo.git
Username: <type your username>
Password: <type your password>
@adisesha
adisesha / generate_pushid.dart
Last active September 11, 2020 02:47 — forked from amirh/generate_pushid.dart
Dart port of Firebase push ID generator (origin: https://gist.github.com/mikelehen/3596a30bd69384624c11)
import 'dart:math' as math;
//See https://firebase.googleblog.com/2015/02/the-2120-ways-to-ensure-unique_68.html
//https://gist.github.com/amirh/0e7b480691f7e6506317a7600398124b
//Modified to remove hyphen and underscore to make ids url freindly
const String _kPushChars =
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
const _pushCharsLength = _kPushChars.length;
class _PushIdGenerator {
@adisesha
adisesha / regexCheatsheet.js
Created January 15, 2019 04:05 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@adisesha
adisesha / fluent-getters-setters
Created May 12, 2016 13:35
Fluent setters and getters templates for InteliJ Idea
public ##
#if($field.modifierStatic)
static ##
#end
$field.type ##
#set($name = $StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project)))
${name}() {
return $field.name;
}