Skip to content

Instantly share code, notes, and snippets.

View dpmango's full-sized avatar
🌎
Available for project-based work

Sergey Khmelevskoy dpmango

🌎
Available for project-based work
View GitHub Profile
@mavieth
mavieth / domains.json
Created January 25, 2020 18:19
Common Email Domains
[
"aol.com",
"att.net",
"comcast.net",
"facebook.com",
"gmail.com",
"gmx.com",
"googlemail.com",
"google.com",
"hotmail.com",
@eladmoshe
eladmoshe / link-certificate.sh
Last active June 8, 2020 21:20
Script for linking a working certificate to create-react-app. Allows you to work with create-react-app and valid SSL certificate.
@endel
endel / number-pad-zero.js
Last active August 1, 2023 11:54
Simplest way for leading zero padding in JavaScript
Number.prototype.pad = function(size) {
var s = String(this);
while (s.length < (size || 2)) {s = "0" + s;}
return s;
}
(1).pad(3) // => "001"
(10).pad(3) // => "010"
(100).pad(3) // => "100"
@hootlex
hootlex / laravellocal.md
Last active May 3, 2024 08:06
Run laravel project locally

##Windows users:

cmder will be refered as console

##Mac Os, Ubuntu and windows users continue here:

  • Create a database locally named homestead utf8_general_ci
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@fjaguero
fjaguero / numberWithThousands.js
Created October 11, 2013 09:28
JS Regex: Adds thousands separator to a number.
// Adds the thousands separator
function numberWithThousands(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
}
@endymion
endymion / contact.rb
Last active February 18, 2024 22:49
Example of integrating a Ruby on Rails app with Zapier using the REST hooks pattern. With support for triggering the REST hooks from Resque background jobs.
class Contact < ActiveRecord::Base
...
def after_create
if Hook.hooks_exist?('new_contact', self)
Resque.enqueue(Hook, self.class.name, self.id)
# To trigger directly without Resque: Hook.trigger('new_contact', self)
end
end
@dciccale
dciccale / demo.html
Last active January 22, 2021 10:40
Styling radios & checkboxes using CSS3 (only for webkit)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Styling radios &amp; checkboxes using CSS3</title>
<link rel="stylesheet" media="screen" href="styles.css" >
</head>
<body>
<h1>Styling radios &amp; checkboxes using CSS3</h1>