Skip to content

Instantly share code, notes, and snippets.

View amir9480's full-sized avatar
🎯
Focusing

Amir Alizadeh amir9480

🎯
Focusing
View GitHub Profile
@lancejpollard
lancejpollard / meta-tags.md
Created March 5, 2012 13:54
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@anandsunderraman
anandsunderraman / gist:5852834
Created June 24, 2013 19:34
Regular Expression to Format Currency In Javascript
function formatCurrency(amount)
{
//truncate the amount to 0 decimals
//for every digit that is followed by 3 digits and a word boundary
//add a comma
amount = amount.toFixed(0).replace(/(\d)(?=(\d{3})+\b)/g, "$1,");
return amount;
}
@JamieMason
JamieMason / unfollow.js.md
Last active July 13, 2024 16:36
Unfollow everyone on twitter.com

Unfollow everyone on twitter.com

  1. Go to https://twitter.com/YOUR_USER_NAME/following
  2. Open the Developer Console. (COMMAND+ALT+I on Mac)
  3. Paste this into the Developer Console and run it
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
@m4tthumphrey
m4tthumphrey / streamed.php
Last active December 28, 2022 08:06
Laravel response macro for streamed responses with seeking support
<?php
Response::macro('streamed', function($type, $size, $name, $callback) {
$start = 0;
$length = $size;
$status = 200;
$headers = [
'Content-Type' => $type,
'Content-Length' => $size,
@ghinda
ghinda / object-to-form-data.js
Last active May 21, 2024 20:48
JavaScript Object to FormData, with support for nested objects, arrays and File objects. Includes Angular.js usage.
// takes a {} object and returns a FormData object
var objectToFormData = function(obj, form, namespace) {
var fd = form || new FormData();
var formKey;
for(var property in obj) {
if(obj.hasOwnProperty(property)) {
if(namespace) {
@FONQRI
FONQRI / calculator.py
Last active April 21, 2022 09:35
A python3 calculator in one line
print(eval(input('Please enter your arithmetic expression :' )))
@wojteklu
wojteklu / clean_code.md
Last active July 19, 2024 11:49
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules