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 playState = { | |
preload: function() { | |
game.stage.backgroundColor = '#3498db'; | |
game.load.spritesheet('player', 'assets/player.png', 28, 22); | |
game.load.image('wall', 'assets/wall.png'); | |
game.load.image('ground', 'assets/ground.png'); | |
game.load.image('dust', 'assets/dust.png'); |
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 namespace PrivacyDriver\Providers; | |
use Cache; | |
use Config; | |
use Illuminate\Contracts\Auth\Access\Gate as GateContract; | |
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; | |
use Illuminate\Support\Collection; | |
use Artisan; | |
use Gate; | |
use PrivacyDriver\Cache\PDRedisStore; |
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
<div id="app"> | |
<div v-if="userId"> | |
<p>You are logged in! Your user ID is: {{userId}}</p> | |
<p>Click <a @click="logout">here</a> to logout</p> | |
</div> | |
<div v-if="!userId"> | |
<p>I don't know you. You should <a @click="login">login</a>.</p> | |
</div> | |
</div> |
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
function hello($name,$sn1){ | |
echo "Hola " . $name . " " . $sn1 . "!"; | |
} |
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 | |
if (!isset($_SERVER['PHP_AUTH_USER'])) { | |
header('WWW-Authenticate: Basic realm="My Realm"'); | |
header('HTTP/1.0 401 Unauthorized'); | |
echo 'Text to send if user hits Cancel button'; | |
exit; | |
} else { | |
echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>"; | |
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>"; | |
} |
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 | |
use Illuminate\Database\Seeder; | |
/** | |
* Class AdminUsersSeeder | |
*/ | |
class AdminUsersSeeder extends Seeder | |
{ | |
/** |
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
private static boolean isConnected(Context context) { | |
ConnectivityManager connectivityManager = (ConnectivityManager) | |
context.getSystemService(Context.CONNECTIVITY_SERVICE); | |
NetworkInfo networkInfo = null; | |
if (connectivityManager != null) { | |
networkInfo = | |
connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); | |
} | |
return networkInfo == null ? false : networkInfo.isConnected(); | |
} |
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/sh | |
#CÒPIA DE SEGURETAT BASE DE DADES MEDIAWIKI | |
# First clean files older than 20 days: http://acacha.org/mediawiki/index.php/Tmpwatch | |
tmpreaper --verbose 20d /linux2/backups/mysql | |
inici=`date` | |
dia=`date "+%Y%m%d"` | |
mysql_backups_folder="/linux2/backups/mysql" | |
echo "##################################################################################" | |
echo "Executant còpia de base de dades (mysqldump) de mediawiki. Inici: $inici" | |
echo "##################################################################################" |
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
protected function _convert_date_to_sql_date($date) | |
{ | |
$date = substr($date,0,10); | |
if(preg_match('/\d{4}-\d{2}-\d{2}/',$date)) | |
{ | |
//If it's already a sql-date don't convert it! | |
return $date; | |
}elseif(empty($date)) | |
{ | |
return ''; |
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
<div class="box box-success"> | |
<div class="box-header with-border"> | |
<h3 class="box-title">Removable</h3> | |
<div class="box-tools pull-right"> | |
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button> | |
</div> | |
</div> | |
<div class="box-body"> | |
The body of the box |