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
coverage | |
build |
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
<project name="saatchiart" default="check" basedir="."> | |
<target name="clean" description="Clean up and create artifact directories"> | |
<delete dir="${project.basedir}/build"/> | |
<mkdir dir="${project.basedir}/build/coverage"/> | |
<mkdir dir="${project.basedir}/build/logs"/> | |
<mkdir dir="${project.basedir}/build/code-browser"/> | |
<mkdir dir="${project.basedir}/build/pdepend"/> | |
</target> | |
<target name="lint" description="Perform syntax check of sourcecode files"> |
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 | |
$whitelist = ['key1', 'key2']; | |
$filterme = ['key1' => 1, 'skipme' => 2]; | |
$filtered = array_filter(array_intersect_key($filterme, array_flip($whitelist))); |
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
- repo: git@github.com:pre-commit/pre-commit-hooks | |
sha: v0.4.2 | |
hooks: | |
- id: trailing-whitespace | |
- id: end-of-file-fixer | |
- id: check-json | |
- id: check-yaml | |
- id: check-merge-conflict | |
- repo: git@github.com:hootsuite/pre-commit-php.git |
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 / | |
sudo du -hsx * | sort -rh | head -10 |
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
SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE COLUMN_NAME LIKE '%sku%' | |
AND TABLE_SCHEMA='zed'; |
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 | |
$onlyKeys = ['ship_width', 'ship_height', 'width', 'height', 'depth', 'ship_depth']; | |
$toCheck = array_intersect_key($artwork, array_flip($onlyKeys)); |
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 | |
// @link http://stackoverflow.com/questions/13507496/pdo-php-insert-into-db-from-an-associative-array | |
$keys = array_keys($a); | |
$sql = "INSERT INTO user (".implode(", ",$keys).") \n"; | |
$sql .= "VALUES ( :".implode(", :",$keys).")"; | |
$q = $this->dbConnection->prepare($sql); | |
return $q->execute($a); |
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 | |
// in a method... | |
$this->client = new GuzzleHttp\Client(['base_uri' => 'my_base_uri']); | |
$config = [ | |
'auth' => [$this->username, $this->password], | |
'headers' => [ | |
'x-app-id' => $this->appId, | |
], |
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 | |
sudo lsof -i :80 # checks port 80 |