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 | |
Config::write("database", array( | |
"development" => array( | |
"driver" => "mysql", | |
"host" => "localhost", | |
"user" => "root", | |
"password" => "", | |
"database" => "nome_do_banco", | |
"prefix" => "", | |
"charset" => "utf8" |
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 | |
/** | |
* Com o environment, você pode escolher qual ambiente de desenvolvimento está | |
* utilizando. É principalmente utilizado na configuração de banco de dados, | |
* evitando que você tenha que redefiní-las a cada deploy. | |
*/ | |
if(file_exists("production.txt")) { | |
Config::write("environment", "production"); | |
} else { | |
Config::write("environment", "development"); |
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 | |
git push origin master | |
ssh [email protected] 'bash -s' < deploy_remote |
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
cd ~/pasta_do_sistema_no_servidor_de_producao | |
git pull ~/.git/nomedorepositorio master | |
touch app/webroot/production.txt |
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
// frameRate padrão será 25fps | |
CanvasRenderingContext2D.prototype.frameRate = 1000/25 | |
// setFrameRate(rate) | |
// @rate: frame rate a ser utilizado (em quadros por segundo - fps -) (ex: 30) | |
CanvasRenderingContext2D.prototype.setFrameRate = function(rate) | |
{ | |
// transforma o frame rate passado de quadros por segundo para ms | |
this.frameRate = Math.round(1000/rate); | |
return this.frameRate; |
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 | |
// retorna array contendo informacoes e um array de numeros aleatórios | |
// num -> quantidade de numeros que deve gerar | |
// amount -> número máximo que pode ser gerado | |
// force_pseudo -> não utilizar o serviço random.org e gerar números pseudo-aleatórios | |
function get_random_numbers($num, $amount, $force_pseudo=false) | |
{ | |
// verifica a quota do servidor com o random.org para ver se é seguro fazer uma requisição agora | |
$c_quota = curl_init("http://www.random.org/quota/?format=plain"); | |
curl_setopt($c_quota, CURLOPT_RETURNTRANSFER, true); |
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
diff -Nru prl_fs.orig/SharedFolders/Guest/Linux/prl_fs/inode.c prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c | |
--- prl_fs.orig/SharedFolders/Guest/Linux/prl_fs/inode.c 2013-11-11 17:56:58.000000000 +0200 | |
+++ prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c 2013-11-29 20:41:53.689167040 +0200 | |
@@ -199,10 +199,18 @@ | |
if (attr->valid & _PATTR_MODE) | |
inode->i_mode = (inode->i_mode & S_IFMT) | (attr->mode & 0777); | |
if ((attr->valid & _PATTR_UID) && | |
- (sbi->plain || sbi->share || attr->uid == -1)) | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) | |
+ (sbi->plain || sbi->share || __kuid_val(attr->uid) == -1)) |
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
-- Create syntax for TABLE 'lists' | |
CREATE TABLE `lists` ( | |
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, | |
`title` varchar(255) DEFAULT NULL, | |
`color` varchar(7) DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
-- Create syntax for TABLE 'tasks' | |
CREATE TABLE `tasks` ( |
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
_window.titleBarDrawingBlock = ^(BOOL drawsAsMainWindow, NSRect drawingRect, NSBezierPath *clippingPath){ | |
NSColor* fillColor = [NSColor colorWithCalibratedRed: 0.076 green: 0.073 blue: 0.076 alpha: 1]; | |
NSColor* strokeColor = [NSColor colorWithCalibratedRed: 0.289 green: 0.289 blue: 0.289 alpha: 1]; | |
NSColor* gradientColor = [NSColor colorWithCalibratedRed: 0.179 green: 0.179 blue: 0.179 alpha: 1]; | |
NSColor* shadowColor2 = [NSColor colorWithCalibratedRed: 0.719 green: 0.714 blue: 0.719 alpha: 1]; | |
NSGradient* gradient = [[NSGradient alloc] initWithColorsAndLocations: | |
strokeColor, 0.0, | |
gradientColor, 0.50, | |
fillColor, 0.51, nil]; |
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
- Apple Watch Design Tips and Tricks | |
- Keynote | |
- How to Discover a Planet: An Evolution of Search and Discovery | |
- Making Magic: Creative Imagination Meets Technological Innovation | |
- Think Audacious | |
- Apple Design Awards | |
- Platforms State of the Union | |
- Performance on iOS and watchOS | |
- App Thinning in Xcode | |
- Advanced NSOperations |
OlderNewer