Skip to content

Instantly share code, notes, and snippets.

View siumhossain's full-sized avatar
🥱
?

sium_hossain siumhossain

🥱
?
View GitHub Profile
@siumhossain
siumhossain / psql_encoding.markdown
Created March 16, 2022 16:12 — forked from joshteng/psql_encoding.markdown
This solves Postgresql's encoding issue (happened to me when running postgres on my vagrant box) The error happens when trying to create db "rake db:create": Error message: "encoding UTF8 does not match locale en_US; the chosen LC_CTYPE setting requires encoding LATIN1"
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';
@siumhossain
siumhossain / repo-reset.md
Created March 10, 2022 19:02 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
import 'package:get/get.dart';
class CountController extends GetxController
{
var count=0.obs;
void increment()
{
count++;
}