Skip to content

Instantly share code, notes, and snippets.

View pinceladasdaweb's full-sized avatar
👊
The only thing I really care about is user experience.

Pedro Rogério pinceladasdaweb

👊
The only thing I really care about is user experience.
View GitHub Profile
const sample = [
[
[
[
[
[
{
foo: [{ rate: 2.18 }],
},
],
@Sydney-o9
Sydney-o9 / install-mongodb-mac-os-x.md
Last active June 30, 2023 08:58
Install MongoDB on Mac OS X without brew

1. Download latest source

# Get latest from MongoDB website
$ curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.4.6.tgz
$ tar -zxvf mongodb-osx-x86_64-3.4.6.tgz
$ mkdir -p mongodb
$ cp -R -n mongodb-osx-x86_64-3.4.6/ mongodb
$ sudo mv mongodb /usr/local
@mihow
mihow / load_dotenv.sh
Last active May 4, 2024 12:32
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@willurd
willurd / web-servers.md
Last active May 4, 2024 07:22
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@bullgare
bullgare / services.js
Created April 8, 2013 11:34
form serialization in pure js
serialize: function serialize(form)
{
if (!form || form.nodeName !== "FORM") {
return;
}
var i, j,
obj = {};
for (i = form.elements.length - 1; i >= 0; i = i - 1) {
if (form.elements[i].name === "") {
continue;
@meritt
meritt / dd-files.js
Created December 17, 2012 14:22
Examples of code for article «Improve the user experience of work with web forms»
var file = document.querySelector('[type=file]');
var dropzone = document.querySelector('.wrapper');
file.addEventListener('change', function() {
previewImages(this.files);
this.value = '';
}, false);
dropzone.addEventListener('dragover', function(event) {
event.preventDefault();
function getXHR(url, callback) {
var xhr = new XMLHttpRequest(); // Creates a new XHR request
if (!url) {
throw new Error('No URL supplied');
}
xhr.open("GET", url, true); // Open the connection
xhr.setRequestHeader("Content-type",
@emilbjorklund
emilbjorklund / breakpoints_via_css.html
Created April 24, 2012 16:03
Width detection via sneaky CSS rules
<!DOCTYPE html>
<!--[if IE 8]> <html lang="sv-SE" class="no-js ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="sv-SE" class="no-js"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<title>Breakpoint detection test</title>
<style type="text/css" media="screen">
@media screen and (min-width: 320px) {
#page:after {
content: 'smallest'; /* represent the current width-bracket */