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
| language: php | |
| php: | |
| - 5.5 | |
| - 5.4 | |
| matrix: | |
| fast_finish: true | |
| mysql: | |
| database: drupal |
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 | |
| $app = new App(); | |
| $app->registerModule(new UserModule()); | |
| $app->run(); |
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
| #!/usr/bin/perl | |
| use IO::Socket::INET; | |
| use Carp; | |
| my $ip='192.168.1.222'; | |
| my $ipport='5200'; | |
| my $serialport='COM4'; # for windows | |
| my $serial='/dev/ttyUSB0'; #for linux | |
| my $baudrate='38400'; |
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 | |
| /** | |
| * Step 01: Define event | |
| */ | |
| class UserLoginEvent extends Symfony\Component\EventDispatcher\Event { | |
| private $user; | |
| public function __construct($user) { |
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
| { | |
| "AWSTemplateFormatVersion": "2010-09-09", | |
| "Description": "VPC knowhow template", | |
| "Parameters": { | |
| "KeyName": { | |
| "Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances", | |
| "Type": "String", | |
| "MinLength": "1", | |
| "MaxLength": "64", | |
| "AllowedPattern": "[-_ a-zA-Z0-9]*", |
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
| # REGULAR VERSION | |
| gunzip -c db.sql.gz | grep -Ev "^INSERT INTO \`(cache_|search_|sessions|whatever)" | mysql -u root -p databasename | |
| # DRUPAL VERSION | |
| gunzip -c db.sql.gz | grep -Ev "^INSERT INTO \`(cache_|search_|sessions|whatever)" | drush sqlc |
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 | |
| /** | |
| * Regex taken from http://saturnboy.com/2010/02/parsing-twitter-with-regexp/ | |
| */ | |
| function parse_tweet($text) { | |
| // Parse links. | |
| $text = preg_replace( | |
| '@(https?://([-\w\.]+)+(/([\w/_\.]*(\?\S+)?(#\S+)?)?)?)@', | |
| '<a href="$1">$1</a>', |
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
| import json | |
| import os | |
| import requests | |
| GITHUB_TOKEN = os.environ.get('GITHUB_TOKEN') | |
| if GITHUB_TOKEN is None: | |
| raise Exception('Missing GITHUB_TOKEN from os.environ') |
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
| #!/bin/sh | |
| :<<'=cut' | |
| =head1 NAME | |
| git-wrapper - avoid committing as you@invalid | |
| =head1 SYNOPSIS |