This file contains 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
/** | |
* Code to blink a LED | |
* | |
* Author: Kadu NovoK | |
* Date: 12-09-2013 | |
* Version: 1.0 | |
*/ | |
void setup() { | |
pinMode(13, OUTPUT); // Set the LED |
This file contains 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
<?php | |
// Code sample to use Transactions | |
// Get the Entity Manager | |
$em = $this->getDoctrine()->getEntityManager(); | |
// Suspend the auto-commit | |
$em->getConnection()->beginTransaction(); |
This file contains 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
<?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), |
This file contains 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
{ | |
Program to sum two values | |
Just to remember the basic of pascal | |
(c) Kadu NovoK <[email protected]> | |
} | |
program sum_program; // Header | |
{ Statements } | |
var |
This file contains 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
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) | |
} | |
}) | |
}); |
This file contains 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
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' | |
}) |
This file contains 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
<!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"> |
This file contains 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
#!/bin/bash | |
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync | |
xrandr --addmode VGA1 "1920x1080_60.00" | |
xrandr --output VGA1 --mode "1920x1080_60.00" |
This file contains 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
<?php | |
$url = "http://localhost/labs/0100/02.php?url=http://ip.jsontest.com/"; | |
$jsonContent = file_get_contents($url); | |
$jsonObject = json_decode($jsonContent); | |
var_dump($jsonObject); | |
echo($jsonObject->ip); |
This file contains 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
var $phone = $("#fos_user_registration_form_phone"); | |
var maskOptions = {onKeyPress: function(phone) { | |
var masks = ['(00) 0000-0000', '(00) 00000-0000']; | |
mask = phone.match(/^\([0-9]{2}\) 9/g) | |
? masks[1] | |
: masks[0]; | |
$phone.mask(mask, this); | |
}}; | |
$phone.mask('(00) 0000-0000', maskOptions); |
OlderNewer