Skip to content

Instantly share code, notes, and snippets.

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 25, 2025 01:26
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@jchandra74
jchandra74 / PowerShell Customization.md
Last active January 8, 2025 09:35
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@abernardobr
abernardobr / Client Code
Created August 14, 2015 13:53
How to upload images to S3 using Graphics Magick and Knox S3 npm module
/ At the client, just use a normal post. I use jQuery and do an AJAX post
// In your HTML
<form id="uploadForm" autocomplete="off" action="" method="post" enctype="multipart/form-data"></form>
<input id='fileId' type="file" accept="image/*">
// In you JS
var $form = $('#uploadForm');
var $file = $('#fileId');
@alanhoff
alanhoff / client.js
Last active October 19, 2024 20:53
Exemplo de SSE com Node.js
var source = new EventSource('http://localhost:8080');
source.addEventListener('message', function(data){
console.log(data);
});
source.addEventListener('open', function(){
console.log('Conexão aberta!');
});
@davidfowl
davidfowl / dotnetlayout.md
Last active April 24, 2025 11:13
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
var cheerio = require('cheerio');
var request = require('request');
var url = 'http://www.americanas.com.br/produto/7112345/geladeira-refrigerador-frost-free-brastemp-clean-brm39-352-litros-inox';
request.get(url, function(err, res, body){
if(err)
throw err;
if(res.statusCode !== 200)
throw new Error('Resporta não OK ' + res.statusCode);
var cheerio = require('cheerio');
var request = require('request');
request.get('http://gshow.globo.com/programas/na-moral/videos/feed.atom', function(err, headers, body){
if(err)
throw err;
if(headers.statusCode !== 200)
throw new Error('Resposta não OK.');
@rrosiek
rrosiek / install_mysql.sh
Last active February 28, 2025 18:55
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Tested with Ubuntu 16.04.
#! /usr/bin/env bash
###
#
# install_mysql.sh
#
# This script assumes your Vagrantfile has been configured to map the root of
# your application to /vagrant and that your web root is the "public" folder
# (Laravel standard). Standard and error output is sent to
# /vagrant/vm_build.log during provisioning.
@swapnilmishra
swapnilmishra / Gruntfile.js
Last active December 20, 2015 17:09
Handle development/production HTML linkings of resources such as JS,CSS so that in development, you would have 2 or more link/script tags but in production you would just point to the minified versions.
module.exports = function(grunt) {
grunt.initConfig({
/*
copy header-template.html which will have placeholders for injecting css,js
*/
copy: {
main: {
files: [
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007