Skip to content

Instantly share code, notes, and snippets.

View ammoradi's full-sized avatar
🏡
Working from home

Amir Mohammad Moradi ammoradi

🏡
Working from home
View GitHub Profile
function isValidIranianNationalCode(input) {
if (!/^\d{10}$/.test(input))
return false;
var check = parseInt(input[9]);
var sum = 0;
var i;
for (i = 0; i < 9; ++i) {
sum += parseInt(input[i]) * (10 - i);
}
@mhmda-83
mhmda-83 / excuses.json
Last active July 26, 2024 11:35
Devloper Excuses (extracted from http://developerexcuses.com/)
[
"The program has never collected that information",
"That wasn't in the original specification",
"The project manager told me to do it that way",
"There's currently a problem with our hosting company",
"Well done, you found my easter egg!",
"That feature would be outside of the scope",
"This code was not supposed to go in to production yet",
"The client must have been hacked",
"I'm still working on that as we speak",
@bgromov
bgromov / git-reset-author.sh
Created June 23, 2016 17:50
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@saumyasuhagiya
saumyasuhagiya / blob_image_save_fetch_node_sequelize.js
Last active March 26, 2020 07:48
Mysql blob image retrieval and insert operation using sequelize package of node.js
var DATABASE_NAME = 'test_db';
var DB_USERNAME = 'abc';
var DB_PASSWORD = 'abc@123';
var Sequelize = require('sequelize');
var FS = require('fs');
var sequelize = new Sequelize(
DATABASE_NAME,
DB_USERNAME,