Skip to content

Instantly share code, notes, and snippets.

View KaduNovoK's full-sized avatar

Carlos Eduardo Rodrigues dos Santos KaduNovoK

View GitHub Profile
@KaduNovoK
KaduNovoK / colors.html
Last active August 29, 2015 14:02
html + js to generate a color variations
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Colors</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
angular.module('myModule')
.config(function ( $httpProvider) {
delete $httpProvider.defaults.headers.common['X-Requested-With'];
}).factory('featuresData', function ($http) {
return{
doCrossDomainGet: function() {
return $http({
url:'http://other.domain.com',
method: 'GET'
})
var teams = [1, 2, 3, 4, 5, 6, 7, 8, 9];
teams.forEach(function(value1, idx1) {
teams.forEach(function(value2, idx2) {
if (idx2+1 > idx1+1) {
console.log(value1, value2)
}
})
});
@KaduNovoK
KaduNovoK / sum_program.pas
Created April 9, 2014 02:14
Program to sum two integer values
{
Program to sum two values
Just to remember the basic of pascal
(c) Kadu NovoK <[email protected]>
}
program sum_program; // Header
{ Statements }
var
@KaduNovoK
KaduNovoK / array_sum.php
Last active August 29, 2015 13:57
Sum the elements of a field in a array with predefined fields
<?php
// Log of players result
$dataArray = array(
array('player' => 'John', 'day' => '1', 'points' => 230),
array('player' => 'Hans', 'day' => '1', 'points' => 300),
array('player' => 'Karl', 'day' => '1', 'points' => 200),
array('player' => 'John', 'day' => '1', 'points' => 250),
array('player' => 'Hans', 'day' => '1', 'points' => 300),
@KaduNovoK
KaduNovoK / transaction.php
Created January 8, 2014 11:42
Transactions in Symfony 2 and Doctrine 2
<?php
// Code sample to use Transactions
// Get the Entity Manager
$em = $this->getDoctrine()->getEntityManager();
// Suspend the auto-commit
$em->getConnection()->beginTransaction();
@KaduNovoK
KaduNovoK / led-blinking.ino
Last active December 30, 2015 20:49
Code to blink a LED on Arduino.
/**
* Code to blink a LED
*
* Author: Kadu NovoK
* Date: 12-09-2013
* Version: 1.0
*/
void setup() {
pinMode(13, OUTPUT); // Set the LED