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
rate := time.Second / 10 // 10 requests a second | |
limit := time.Tick(rate) | |
for req := range messages { | |
<-limit | |
go makeRequest(req) | |
} |
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
# Configuration file for runtime kernel parameters. | |
# See sysctl.conf(5) for more information. | |
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for | |
# an explanation about some of these parameters, and instructions for | |
# a few other tweaks outside this file. | |
# Protection from SYN flood attack. | |
net.ipv4.tcp_syncookies = 1 |
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
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
type Foo struct { | |
FirstName string `tag_name:"tag 1"` | |
LastName string `tag_name:"tag 2"` |
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
Authenticate with GitHub to increase your rate limit and allow you | |
to pull from private repositories. To do that, add the following | |
entry to your ~/.netrc file: | |
machine api.github.com | |
login <username> | |
password <token> |
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
Show hidden characters
{ | |
// -------------------------------------------------------------------- | |
// JSHint Configuration, Strict Edition | |
// -------------------------------------------------------------------- | |
// | |
// This is a options template for [JSHint][1], using [JSHint example][2] | |
// and [Ory Band's example][3] as basis and setting config values to | |
// be most strict: | |
// | |
// * set all enforcing options to true |
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
/* Exercise: Loops and Functions #43 */ | |
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := float64(2.) |
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/env php | |
<?php | |
$namespace = 'DE'; | |
//I want to generate deafult bundle | |
`php app/console generate:bundle --namespace={$namespace}/AppBundle --bundle-name=AppBundle --no-interaction --dir=src/`; | |
`rm -rf src/Acme`; | |
`rm -rf web/bundles/acmedemo`; |
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
/** | |
* @Rest\View() | |
* @ParamConverter("partner", class="AppBundle:Partner") | |
*/ | |
public function getAction(Partner $id) | |
{ | |
$view = $this->view($id); | |
return $this->handleView($view); | |
} |
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
{% extends app.request.xmlHttpRequest | |
? '::ajax-layout.html.twig' | |
: '::full-layout.html.twig' %} |
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
/** | |
* @When /^I check "([^"]*)" if not checked yet$/ | |
*/ | |
public function iCheckIfNotCheckedYet($id) | |
{ | |
$Page = $this->getSession()->getPage(); | |
$isChecked = $Page->find('css', 'input[type="checkbox"]:checked#' . $id); | |
if (!$isChecked) { | |
$Page->find('css', '#' . $id)->click(); | |
} |