Skip to content

Instantly share code, notes, and snippets.

View romainnorberg's full-sized avatar
🏖️

Romain romainnorberg

🏖️
  • Freelance
  • World
View GitHub Profile
@wadey
wadey / iterm2.zsh
Last active January 13, 2025 14:26
Change iTerm2 tab color when using SSH
# Usage:
# source iterm2.zsh
# iTerm2 tab color commands
# https://iterm2.com/documentation-escape-codes.html
if [[ -n "$ITERM_SESSION_ID" ]]; then
tab-color() {
echo -ne "\033]6;1;bg;red;brightness;$1\a"
echo -ne "\033]6;1;bg;green;brightness;$2\a"
@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";
@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]"
@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)

@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;
@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);
@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.

@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
*/
@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!!
#test { counter-reset: c; }
#test span { counter-increment: c; }
#test span:before { content: counter(c, decimal-leading-zero); }