Skip to content

Instantly share code, notes, and snippets.

View Sathiyapramod's full-sized avatar
🎯
Focusing

Sathiyapramod Raghavendran Sathiyapramod

🎯
Focusing
View GitHub Profile
@mlconnor
mlconnor / country_date_formats.csv
Created February 22, 2012 20:49
Listing of countries with their preferred date formats, ISO3166 code, ISO629-2
ISO 3166 Country Code ISO639-2 Country Code Country ISO 3166 Country Code ISO639-2 Lang Language Date Format
ALB AL Albania sqi sq Albanian yyyy-MM-dd
ARE AE United Arab Emirates ara ar Arabic dd/MM/yyyy
ARG AR Argentina spa es Spanish dd/MM/yyyy
AUS AU Australia eng en English d/MM/yyyy
AUT AT Austria deu de German dd.MM.yyyy
BEL BE Belgium fra fr French d/MM/yyyy
BEL BE Belgium nld nl Dutch d/MM/yyyy
BGR BG Bulgaria bul bg Bulgarian yyyy-M-d
BHR BH Bahrain ara ar Arabic dd/MM/yyyy
@drublic
drublic / dabblet.css
Created February 29, 2012 15:40
Pseudo-elements for select
/**
* Pseudo-elements for select
*/
select {
-webkit-appearance: none;
}
select:after {
content: 'abc';
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active June 26, 2024 05:00
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@pierrejoubert73
pierrejoubert73 / psql-import-db-dump.md
Last active June 14, 2024 17:24
How to import a dump file in PSQL.

Open terminal.

Connect to psql:

psql -p 5433

I find it easier to delete and recreate the DB to which you want to import. So ensure the databse you want to delete is listed:

\l

@niteshpsit1
niteshpsit1 / gist:c90b3336ee639c89ae13b98825c9d9ca
Created December 1, 2016 10:26
Sorting an array order by frequency of occurence in javascript
/**
* Sorting an array order by frequency of occurence in javascript
* @param {array} array An array to sort
* @returns {array} array of item order by frequency
**/
function sortByFrequency(array) {
var frequency = {};
var sortAble = [];
var newArr = [];
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active June 26, 2024 16:11
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 26, 2024 18:43
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@xameeramir
xameeramir / default nginx configuration file
Last active June 22, 2024 13:25
The default nginx configuration file inside /etc/nginx/sites-available/default
# Author: Zameer Ansari
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@NigelEarle
NigelEarle / Knex-Migrations-Seeding.md
Last active June 19, 2024 14:20
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

@Jiang-Xuan
Jiang-Xuan / countdown.js
Created March 1, 2018 02:56
Using Promise get a countdown utility function.
let remain = 60;
const ct = Promise.resolve();
const countdown = (ct) => (Promise.all([new Promise(resolve => {
setTimeout(() => {
remain--;
this.setState({
getCapchacodeRemainTime: remain
});
resolve(remain);