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 <stdio.h> | |
#define CIDADES 20 | |
int explorado[CIDADES], | |
localizacoes[CIDADES][CIDADES] = | |
{ | |
{0, 71, -1, -1, -1, -1, -1, -1, -1, 151, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, | |
{71, 0, 75, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, | |
{-1, 75, 0, 118, -1, -1, -1, -1, -1, 140, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, |
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 <stdio.h> | |
#include <stdlib.h> | |
struct _element { | |
struct _element *prev, *next; | |
int value; | |
}; | |
struct _column { | |
struct _column *prev, *next; |
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
<?php | |
$HEIGHT = 600; | |
$WIDTH = 1000; | |
$xfactor = 2; 5; | |
$yfactor = 1; 0.001; 0.5; | |
$CENTER_X = $WIDTH/2; | |
$CENTER_Y = 400; |
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
<?php | |
function stickFile ($file, $x, $y) | |
{ | |
global $dest; | |
$img = imagecreatefromjpeg($file["tmp_name"]); | |
$thumb = imagecreatetruecolor(150, 150); | |
list($width, $height) = getimagesize($file["tmp_name"]); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
canvas { border: 1px solid #DDD; } | |
</style> | |
</head> | |
<canvas width=1500 height=1000></canvas> | |
<script> | |
var ctx = document.querySelector('canvas').getContext('2d'), |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf8"> | |
<title>Pong Game</title> | |
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/css/bootstrap.min.css" rel="stylesheet"> | |
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.css" rel="stylesheet"> | |
<style type="text/css"> |
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
// Extend PATCH:true option of Backbone. | |
// When model.save([attrs], {patch:true}) is called: | |
// - the method is changed to PUT; | |
// - the data sent is a hash with the passed attributes and their values; | |
var originalSync = Backbone.sync; | |
Backbone.sync = function(method, model, options) { | |
if (method === 'patch' && options.attrs instanceof Array) { | |
// pop attributes and add their values | |
while (e = options.attrs.pop()) | |
options.attrs[e] = model.get(e); |
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
painter = | |
applyCanvasOptions : (context, options) -> | |
if options.fill is true | |
context.fillStyle = options.color or 'black' | |
else | |
context.strokeStyle = options.color or 'blue' | |
context.lineWidth = options.width or 1 | |
###### Canvas manipulation functions |
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
window.AnimateOnFrameRate = do -> | |
# thanks, Paul Irish | |
window.requestAnimationFrame or | |
window.webkitRequestAnimationFrame or | |
window.mozRequestAnimationFrame or | |
window.oRequestAnimationFrame or | |
window.msRequestAnimationFrame or | |
(callback) -> | |
window.setTimeout callback, 1000/60 |
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
// ==UserScript== | |
// @name youtube plz | |
// @namespace http://use.i.E.your.homepage/ | |
// @version 0.1 | |
// @description enter something useful | |
// @match http://www.youtube.com/watch?* | |
// @match https://www.youtube.com/watch?* | |
// @copyright 2012+, You | |
// ==/UserScript== |
OlderNewer