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
// /etc/polkit-1/rules.d/10-rules.rules | |
// PolKit rules to allow mounting, rebooting and network management without a password. | |
// User needs to be in storage, power and network groups. | |
polkit.addRule(function(action, subject) { | |
if (action.id.match("org.freedesktop.udisks2.") && subject.isInGroup("storage")) { | |
return polkit.Result.YES; | |
} | |
}); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="${projectName}" basedir="." default="build:main"> | |
<!-- Properties --> | |
<property name="dir.app" value="${project.basedir}/app" /> | |
<property name="dir.src" value="${project.basedir}/src" /> | |
<property name="dir.build" value="${project.basedir}/app/build" /> | |
<property name="dir.docs" value="${dir.build}/docs" /> | |
<property name="dir.docs.phpdoc" value="${dir.docs}/phpdoc" /> | |
<property name="dir.docs.docblox" value="${dir.docs}/docblox" /> | |
<property name="dir.reports" value="${dir.build}/logs" /> |
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 | |
set_time_limit(0); | |
ini_set('memory_limit',-1); | |
function parse_csv_assoc($str,&$f) { | |
if (empty($f)) { $f = str_getcsv($str); } | |
return @array_combine($f, str_getcsv($str)); | |
} |
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
$filename="export.csv"; | |
header("Content-type: application/octet-stream"); | |
header("Content-Disposition: attachment; filename=$filename"); | |
header("Pragma: no-cache"); | |
header("Expires: 0"); | |
$csv = fopen('php://output', 'w'); | |
foreach($rows as $ind=>$row){ | |
if($ind==0) | |
fputcsv($csv,array_keys($row)); |
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
<!-- BEGIN: Pre-Bootstrap Loading Screen. --> | |
<div ng-if="false"> | |
<p> | |
This will show until the application is bootstrapped. | |
Then, the ngIf directive will immediately rip it out of | |
the page. | |
</p> | |
</div> |
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 | |
class DefaultController extends Controller | |
{ | |
/** | |
* Dashboard page. | |
* @Permissions(perm="dashboard_view") | |
* @Route("/", name="ITEDashboardBundle_index") | |
* @Template() | |
* @return array |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
1. Check if /etc/default/grub has | |
GRUB_CMDLINE_LINUX_DEFAULT=" resume=/dev/sda2 splash=silent quiet showopts" | |
and "resume" points to the correct SWAP partition. | |
2. Check if using any nvidia drivers. If so - uninstall them and make sure to remove any files that blacklist "nouveau": | |
cd /etc/modprobe.d/ | |
grep -i -R "nouveau" . |
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 | |
class MyController extends Controller { | |
public function myAction() { | |
$finder = new Finder(); | |
/** | |
* @var SplFileInfo $file | |
*/ | |
foreach($finder->name('*ProjectContainer*')->depth(0)->in($this->getParameter('kernel.cache_dir')) as $file){ |