Skip to content

Instantly share code, notes, and snippets.

View macedd's full-sized avatar
🐋
Looking for growth opportunities

Thiago F Macedo macedd

🐋
Looking for growth opportunities
View GitHub Profile
@callmeloureiro
callmeloureiro / comoNaoDeixarNoVaucoNoWhatsapp.js
Last active June 5, 2021 13:29
Como não deixar no vácuo no whatsapp
/*
Hoje não deixaremos mais ninguém no vácuo no whatsapp
Para utilizar:
- Abra o web.whatsapp.com;
- Abra o console e cole o código que está no gist;
- Aguarde e verá uma mensagem sendo enviada a cada momento que alguém te enviar alguma mensagem.
Confira também como ser chato no whatsapp: https://gist.github.com/mathloureiro/4c74d60f051ed59650cc76d1da0d32da
e como ser chato no mensseger: https://gist.github.com/mathloureiro/d3f91d19cf148838217e42a0c6df5ed8
*/
@DawidMyslak
DawidMyslak / vue.md
Last active April 22, 2024 12:49
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modifying state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.

@blvz
blvz / gh-deploy-clone.sh
Last active August 23, 2023 23:15
Creates a deploy key and clones the repository.
#!/usr/bin/env bash
read -r -d '' usage << EOM
Usage:
gh-deploy-clone user/repo [ENVIRONMENT]
EOM
[ -z "$1" ] && echo && echo "$usage" && echo && exit 1
@jyore
jyore / MacBookNetworkAliveOnSleep.md
Last active January 2, 2024 15:18
Keep Your MacBook Network Connections Alive As It Sleeps!

MacBookNetworkAliveOnSleep

As someone that regularly has multiple SSH/VPN sessions open, it can be a huge inconvience to lose all the connections when I lock my screen to get up to go to a meeting, lunch, etc. This is especially true for those connections that require two factor authentication. So, how can I tell my MacBook to keep those connections alive, even though my screen is locked?

Well, turns out that it is pretty simple. All that is needed is to run the following command.

cd /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources
sudo ./airport en0 prefs DisconnectOnLogout=NO
@jasongilman
jasongilman / atom_clojure_setup.md
Last active January 11, 2024 09:13
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

On every WP site I do, where i'm the only developer, I add this to the config
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
<?
define('WP_HOME', 'http://'.$_SERVER['SERVER_NAME']);
define('WP_SITEURL', 'http://'.$_SERVER['SERVER_NAME']);
?>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
But my Localhost/dev-enviroment I setup my own domain, such as http://website.pp (.pp = .paulypops; it's just something that doesn't exist outside of my network).
But sometimes I also do the following if I've got a few collegues
@mathetos
mathetos / functions.php
Created January 23, 2015 06:18
User-Friendly Styled Content in the WordPress Editor
<?php
/*
* Add "Formats" dropdown to TinyMCE Editor
*/
function matt2015_mce_formats($buttons) {
array_unshift($buttons, 'styleselect');
return $buttons;
}
add_filter('mce_buttons_2', 'matt2015_mce_formats');
@richard-flosi
richard-flosi / assertions-compareScreenshot.js
Created August 27, 2014 14:25
Nightwatch with Visual Regression testing
// assertions/compareScreenshot.js
var resemble = require('resemble'),
fs = require('fs');
exports.assertion = function(filename, expected) {
var screenshotPath = 'test/screenshots/',
baselinePath = screenshotPath + 'baseline/' + filename,
resultPath = screenshotPath + 'results/' + filename,
diffPath = screenshotPath + 'diffs/' + filename;
@mikermcneil
mikermcneil / sails-core.md
Last active August 29, 2015 14:04
share-able/replace-able parts of sails core

Ironically, Sails is actually becoming less and less MVC focused internally (see https://github.com/sails101/like-express for an example of what you can do now) On a separate note, I've been gradually working on making the Express dep optional in sails core for a while now. Features like views/static middleware/the orm/etc should be swappable IMO, e.g. you might only need/want socket.io. That was the whole idea of the "hooks" thing in 0.9 (original proposal.

So anyways I thought it might be useful to list how I'm applying Express 3 in Sails as a data point/use case:

Nowadays, Sails core (minus the cli) is essentially:

1. router

@magnetikonline
magnetikonline / README.md
Last active April 30, 2024 00:45
Setting Nginx FastCGI response buffer sizes.