This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//One Key MIDI Piano | |
//This is a test for Serial MIDI output through Arduino USB port | |
//Used Hairless Midi as Serial->MIDI bridge and one push button on pin 53 of Arduino Mega 2560 | |
//Connect GND|<------{|Button|}------>| Pin 53 | |
//Plays a G#2 which is mapped to cowbell on the drums of GarageBand | |
#include <MIDI.h> | |
#include <midi_Defs.h> | |
#include <midi_Message.h> | |
#include <midi_Namespace.h> | |
#include <midi_Settings.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Select-Folder($message='Select a folder', $path = 0) { | |
$object = New-Object -comObject Shell.Application | |
$folder = $object.BrowseForFolder(0, $message, 0, $path) | |
if ($folder -ne $null) { | |
$folder.self.Path | |
} | |
} | |
$Title = "Renomear Fotos Automaticamente"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2015-12-01 - Varlen Pavani Neto | |
// Use este snippet para esconder as sessões 3D do site da Ingresso.com | |
// Esconder todas as sessões 3D | |
var $hateful3dSessions = $('.tipo-sessao.3D').parents('li.place-hours-it'); | |
$hateful3dSessions.hide(); | |
// Esconder os cinemas que só tiverem sessões 3D | |
var $allTheaterSessions = $hateful3dSessions.parent(); | |
$allTheaterSessions.each( function( ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// No Gmail, o ID do botao sempre muda quando a pagina é atualizada | |
// Mudar o id na linha abaixo | |
btnElementID = ''; | |
btn = document.getElementById(btnElementID); | |
intervalID = window.setInterval( function checkTime() { | |
// https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Date | |
var send_on = new Date( 2015,11,8,6,0 ); | |
var now = new Date(); | |
if ( now.getTime() > send_on.getTime() ) { | |
console.info( 'Mandei!' ); // Sent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from win32file import * | |
import struct, time | |
CONST_PPJOY_DEVICE = "\\\\.\\PPJoyIOCTL1" | |
CONST_LOAD_POSITIONS = 0x910 | |
class vJoy(object): | |
def __init__(self): | |
self.handle = None | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyfirmata import Arduino, util, STRING_DATA | |
board = Arduino('COM6') | |
board.send_sysex( STRING_DATA, util.str_to_two_byte_iter('Hello!') ) | |
def msg( text ): | |
if text: | |
board.send_sysex( STRING_DATA, util.str_to_two_byte_iter( text ) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Foundation import * | |
from ScriptingBridge import * | |
# Returns the methods of the object | |
def __methods( theObject ): | |
return [method for method in dir(theObject) if callable(getattr(theObject, method))] | |
# Elements present in one list but not in the other | |
def __diffList( A, B): | |
return list( set( A ) - set( B ) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int analogPin1 = 1; // 1a. entrada analógica | |
int analogPin2 = 2; // 2a. entrada analógica | |
int primeira_vez = 1; | |
int i = 1; // contador do while que vai calcular a média dos valores de entrada | |
int k1 = 0; // contador do número de picos que serão encontrados | |
int sinal_original_um[99]; | |
int sinal_original_dois[99]; | |
int time1[99]; | |
int time2[99]; | |
int contador_de_medidas; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all | |
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all | |
lg = !"git lg1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Stepper.h> | |
const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution | |
// for your motor | |
// initialize the stepper library on pins 8 through 11: | |
Stepper myStepper(stepsPerRevolution, 2, 3, 4, 5); | |
int stepCount = 0; // number of steps the motor has taken |
OlderNewer