Skip to content

Instantly share code, notes, and snippets.

View gabrielgodoy-zz's full-sized avatar

Gabriel Godoy gabrielgodoy-zz

View GitHub Profile
@gabrielgodoy-zz
gabrielgodoy-zz / loop-custom.php
Created September 22, 2018 03:56 — forked from kevinwhoffman/loop-custom.php
WordPress - Custom Post Type Loop
<?php
$loop = new WP_Query( array(
'post_type' => 'Property',
'posts_per_page' => -1
)
);
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
```js
// Place your settings in this file to overwrite the default settings
{
"window.zoomLevel": 0,
"editor.fontSize": 14,
"editor.tabSize": 2,
"editor.tabCompletion": true,
"editor.snippetSuggestions": "top",
"editor.renderWhitespace": "boundary",
"sync.gist": "cd6aaed4a15ba1a0eaea3f3a9bf7d1f1",

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
npm init -y
/*
Slow way
*/
var utils = {
fibonacci: function(n) {
if (n === 0) {
return 0;
}
if (n === 1) {
@gabrielgodoy-zz
gabrielgodoy-zz / check-pr-locally.sh
Created February 17, 2017 20:46
Fetch and check PR locally
git fetch origin pull/[PULL_ID]/head:[BRANCHNAME]
git checkout BRANCHNAME
Example
git fetch origin pull/40/head:feat/definition-module-refactoring
@gabrielgodoy-zz
gabrielgodoy-zz / Default%20%28OSX%29.sublime-keymap
Last active March 28, 2018 12:48
Sync Settings Sublime Text
[{
"keys": ["super+alt+l"],
"command": "htmlprettify"
}, {
"keys": ["super+backspace"],
"command": "run_macro_file",
"args": {
"file": "res://Packages/Default/Delete Line.sublime-macro"
}
},
@gabrielgodoy-zz
gabrielgodoy-zz / CONTRIBUTING.md
Created January 11, 2017 02:47
Contributing template

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin my-new-feature

Remember that we have a pre-push hook with steps that analyzes and prevents mistakes.

After your pull request is merged, you can safely delete your branch.

@gabrielgodoy-zz
gabrielgodoy-zz / _font-face.styl
Created December 19, 2016 23:58
Generates CSS for font-face
font-url(file)
return "../fonts/" + file
webfont(family, file, hack-chrome-windows = false, weight = "normal")
@font-face
font-family family
src url(font-url(file + ".eot"))
src url(font-url(file + ".eot?#iefix")) format("embedded-opentype"), url(font-url(file + ".woff")) format("woff"), url(font-url(file + ".ttf")) format("truetype"), url(font-url(file + ".svg#" + family)) format("svg")
font-weight weight
font-style normal
@gabrielgodoy-zz
gabrielgodoy-zz / flat-array.js
Last active December 16, 2016 22:44
Flat array
let someArray = [[1, 2, [3]], 4];
function flatArray(arrayToFlat) {
let arrayFlattened = [];
if (!Array.isArray(arrayToFlat)) {
return 'This is not an object of type Array';
}
function flat(arrayToFlat) {
arrayToFlat.map((arrayItem, index, arr) => {
if (Array.isArray(arrayItem)) {
#!/bin/sh
#
# Brew packages that I use alot.
#
brew install wget
brew install node
brew install imagemagick
#
# Some cask packages that I like.
#