Skip to content

Instantly share code, notes, and snippets.

@jchandra74
jchandra74 / PowerShell Customization.md
Last active March 1, 2024 01:02
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 July 28, 2023 07:41
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, 2024 18:49
.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 June 5, 2023 07:08
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
@liamdon
liamdon / gist:2467603
Created April 22, 2012 23:53
CoffeeScript, Jade and Stylus syntax highlighting in Sublime Text 2

Step 1: Clone the bundles into your Sublime Text packages directory

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScript
git clone https://github.com/miksago/jade-tmbundle.git Jade
git clone https://github.com/LearnBoost/stylus.git Stylus

Step 2: Restart Sublime Text 2