View launchpad-reset.sh
defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock
View brew-cask.md
for i in $(brew cask list); do echo $(brew cask info $i) >> casks.txt; echo "\n-----------\n" >> casks.txt; done;
View add_keys.sh
cat ~/.ssh/id_rsa.pub | ssh USER@HOST "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
View get-vw.sass
$vw-viewport: 320
$vw-enable: true
@function get-vw($font)
@if $vw-enable
$vw-context: $vw-viewport * 0.01 * 1px
@return $font / $vw-context * 1vw
@return $font
View remove_accents.php
<?php
/*
* Converts all accent characters to ASCII characters.
*
* If there are no accent characters, then the string given is just returned.
*
* @since 1.2.1
* @source https://core.trac.wordpress.org/browser/tags/4.3.1/src/wp-includes/formatting.php#L1056
*
View Client.java
package br.diegoscosta.com.socketchat;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.Socket;
public class Client
{
public static void main(String argv[]) throws Exception
View pull.sh
#!/bin/bash
# This scripts synchronize multiple repositories in sub-folders
# Usage: ./pull.sh ; to synchronize repositories in current file location
# Usage: ./pull.sh C:/Projects/ ; to synchronize other directory
# Author: Diego Costa <http://github.com/diegoscosta>
if [ "$1" ]; then
cd $1
echo "Syncing $1"
View RubyGemsSSLFix.bat
gem sources -r https://rubygems.org/
gem sources -a http://rubygems.org/
gem update --system
gem sources -r http://rubygems.org/
gem sources -a https://rubygems.org/
gem update
View wishlistr.random.dev.js
(function(){
var content = document.querySelectorAll("ul.wishlist > li");
if(content.length > 0){
var selectedContent = content[Math.floor(Math.random() * content.length )];
var detalhes = selectedContent.querySelector('div.details');
if(confirm("O item escolhido foi " + detalhes.querySelector("h4").innerText)){
View 180.ino
#include <Servo.h>
/*
* @description Fazer um carro projetado em Arduino dá uma volta de 180º quando encontrar um obstáculo.
*/
Servo servomotorEsquerdo;
Servo servomotorDireito;
void setup()