Skip to content

Instantly share code, notes, and snippets.

View romainnorberg's full-sized avatar
🏖️

Romain romainnorberg

🏖️
  • Freelance
  • World
View GitHub Profile
@omeinusch
omeinusch / create-mysql.bash
Created August 31, 2013 11:50
Simple bash script to create mysql db, user with generated password
#!/bin/bash
PASS=`pwgen -s 40 1`
mysql -uroot <<MYSQL_SCRIPT
CREATE DATABASE $1;
CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost';
FLUSH PRIVILEGES;
MYSQL_SCRIPT
#test { counter-reset: c; }
#test span { counter-increment: c; }
#test span:before { content: counter(c, decimal-leading-zero); }
@mystix
mystix / install-elasticsearch-debian
Last active March 19, 2023 15:14 — forked from karussell/install-elasticsearch-debian
Install ElasticSearch on Debian
VERSION=0.20.6
sudo apt-get update
sudo apt-get install openjdk-6-jdk
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$VERSION.deb
sudo dpkg -i elasticsearch-$VERSION.deb
# be sure you add "action.disable_delete_all_indices" : true to the config!!
@benedict-w
benedict-w / neteven_webservice_examples.php
Created January 23, 2013 11:58
Neteven examples taken from Web Services Technical Guide v1.8_EN 21
<?php
/**
* May 2012 Web Services Technical Guide v1.8_EN 21
*
* Note: information must be encoded with utf8_encode function
*
* Library used: PHP5 SOAP library
* http://php.net/soap
*/
@aponxi
aponxi / sql-mongo_comparison.md
Last active December 12, 2024 01:11
MongoDb Cheat Sheets

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

@faridjame
faridjame / gist:3744706
Created September 18, 2012 18:04
PHP: send multi attachment emails with swiftmailer
<?php
require_once('swift/lib/swift_required.php');
$email = $_POST['email'];
$subject = "my subject";
$user_message = "<b>message body</b>";
$mailer = new Swift_Mailer(new Swift_MailTransport());
$message = Swift_Message::newInstance();
$message->setSubject($subject);
@Ziumin
Ziumin / MockingDialogTest.php
Created July 26, 2012 09:22
[Symfony2] Mocking user input when testing commands
<?php
namespace XXX\ToolkitBundle\Tests\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use XXX\ToolkitBundle\Command\CommonGenerateCommand;
@asabaylus
asabaylus / gist:3071099
Created July 8, 2012 14:12
Github Markdown Heading Anchors

Anchors in Markdown

To create an anchor to a heading in github flavored markdown. Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:

[create an anchor](#anchors-in-markdown)

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@jrom
jrom / nginx.conf
Created February 7, 2012 17:14
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";