Skip to content

Instantly share code, notes, and snippets.

View gist:9bb5b06a815d65431a3c
public function getMobileDeviceType()
{
//get the detector
$detect = new \Detection\MobileDetect();
$type = false;
if ($detect->isMobile()) {
$type = "phone";
if ($detect->isTablet()) {
$type = "tablet";
View gist:7bce6e61f5bd058d5e93
public function getMobileDeviceType()
{
//get the detector
$detect = new \Detection\MobileDetect();
$type = false;
if ($detect->isMobile()) {
$type = "phone";
if ($detect->isTablet()) {
$type = "tablet";
View gist:f2f17c7deee621a82337
<?php
namespace Pledgevine\Db;
use Zend\Db\Sql\Select;
use Zend\Db\TableGateway\AbstractTableGateway;
//works exactly like a table gateway except it wont throw exceptions if you havent specified a table
//notice the lines are just commented
//
View gist:d537a911ff4d7765d45b
<?php
namespace Pledgevine\Db;
use Zend\Db\Sql\Select;
use Zend\Db\TableGateway\AbstractTableGateway;
//works exactly like a table gateway except it wont throw exceptions if you havent specified a table
//notice the lines are just commented
//
View gist:c92463e639e3888939f1
$client = $this->getServiceLocator()->get('PaypalAdaptiveHttpClient');
$client->setUri($this->getConfig()['url'] . '/' . $name);
$client->setParameterPost($queryParams);
$httpResponse = $client->send();
return json_decode($httpResponse->getBody());
View gist:fcc14a34f8ed6322d420
ansible-playbook -i ansible/production.hosts -u deploy ansible/deploy.yml --limit staging
ansible-playbook -i ansible/production.hosts -u deploy ansible/deploy.yml --limit production
View gist:f20a4372ed8e49d224c2
[nlundsten@localhost ~]$ yum clean all && sudo yum install kmod-nvidia
Loaded plugins: langpacks
Cleaning repos: fedora google-chrome google-talkplugin mysql56-community rpmfusion-free rpmfusion-free-updates rpmfusion-nonfree rpmfusion-nonfree-updates updates
Cleaning up everything
[sudo] password for nlundsten:
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package kmod-nvidia.x86_64 1:346.35-1.fc21 will be installed
--> Processing Dependency: kmod-nvidia-3.18.2-200.fc21.x86_64 >= 1:346.35-1.fc21 for package: 1:kmod-nvidia-346.35-1.fc21.x86_64
View gist:0092988467b65f3a8621
[nlundsten@localhost ~]$ uname -r
3.17.8-300.fc21.x86_64
[nlundsten@localhost ~]$ sudo yum install kmod-nvidia-3.17.8-300.fc21.x86_64-343.36-1.fc21.2
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package kmod-nvidia-3.17.8-300.fc21.x86_64.x86_64 1:343.36-1.fc21.2 will be installed
--> Processing Dependency: nvidia-kmod-common >= 1:343.36 for package: 1:kmod-nvidia-3.17.8-300.fc21.x86_64-343.36-1.fc21.2.x86_64
--> Running transaction check
---> Package xorg-x11-drv-nvidia.x86_64 1:346.35-1.fc21 will be installed
View gist:6d5fa8da9da31b46be20
Section "Device"
Identifier "nvidia"
Driver "nvidia"
Option "NoLogo" "true"
Option "DPI" "96 x 96"
# Specify Nvidia PCI device
BusID "PCI:1:0:0"
# Make sure X starts also when no outputs are connected to the Nvidia chip
Option "AllowEmptyInitialConfiguration"
EndSection
View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC1dHgWQCfPmAMMPDPeHr4RcvSpdUaAwyC0Szl6n73fDF7KZEk3cPlp6MSmrMEW4kti81zBSuWayloqkadadkRrXa02P6UAJKfpQtQJoCpDtWgroDzBQ8G6VjouRbqiLz58hUp0K1XbxrxEEIJX46HhlhkkQMBa7YLeg0roiYPEpcsLWrLPTe8xAFLU+6mh0cwFP0/BjUFiAUj2Issa6ZqodkBhLbCgtDmNCpKBulW7/WIIZJ1jkGez60Y2qEp0xhWVpfjQM7RAXixPBQvJ0zIKuB4CHR9z13hdBAlP8UT6bjo6+9asW6QOcskPcpR9smwxoi6Ok4KXyoSM73BRiZrF