Skip to content

Instantly share code, notes, and snippets.

View Majkl578's full-sized avatar
💥
breaking builds

Michael Moravec Majkl578

💥
breaking builds
View GitHub Profile
@d11wtq
d11wtq / docker-ssh-forward.bash
Created January 29, 2014 23:32
How to SSH agent forward into a docker container
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash
@andrewlkho
andrewlkho / gist:7373190
Last active January 15, 2025 08:43
How to use authentication subkeys in gpg for SSH public key authentication

GPG subkeys marked with the "authenticate" capability can be used for public key authentication with SSH. This is done using gpg-agent which, using the --enable-ssh-support option, can implement the agent protocol used by SSH.

Requirements

A working gpg2 setup is required. It may be possible to use gpg 1.4 but with gpg-agent compiled from gpg2. If you are using OS X 10.9 (Mavericks) then you may find the instructions [here][1] useful.

@rxaviers
rxaviers / gist:7360908
Last active May 11, 2025 05:31
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@nikic
nikic / php_evaluation_order.md
Last active October 19, 2021 05:47
Analysis of some weird evaluation order in PHP

Order of evaluation in PHP

Yesterday I found some people on my [favorite reddit][lolphp] wonder about the output of the following code:

<?php

$a = 1;
$c = $a + $a++;
@milo
milo / .autoprepend.php
Created August 20, 2013 07:51
Handy Tracy/Nette Debugger in autoprepend file
<?php
function __nette($version = NULL) {
if ($version) {
require "/var/www/lib/nette/$version/Nette/loader.php";
} else {
require '/var/www/dev/nette/Nette/loader.php';
}
}
@Elijen
Elijen / export.sql
Created April 11, 2013 09:51
Export from MySQL to CSV directly
SELECT id, name, email INTO OUTFILE '/tmp/result.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY ‘\\’
LINES TERMINATED BY '\n'
FROM users WHERE 1
@nikic
nikic / php-5.5-features.md
Last active August 31, 2020 10:39
List of new features in PHP 5.5
@ChrisLundquist
ChrisLundquist / splitter.rb
Created December 19, 2012 22:12
split apart a monolithic repo into several smaller ones while preserving commit history.
#!/usr/bin/env ruby
BASE_REMOTE_URL = "[email protected]:chef"
folders = ARGV
pwd = Dir.pwd
folders.each do |folder|
name = folder.split("/").last
name = name.gsub("-","_")
clone_command = "git clone chef/ #{name}"
system clone_command
Dir.chdir name
@bartku
bartku / gist:4271798
Last active November 25, 2024 15:08
Unofficial description of unofficial World of Tanks API

World of Tanks unofficial API

World of Tanks, popular MMO game about tanks from time around WWII, has some nice mobile application called Wot Assistant (available also at AppStore and MS Marketplace). With simple packet sniffing you can guess how it retrieves players' statistics.

Surprisingly, mobile application uses quite simple API over HTTP which serves data in JSON, which is great help for people interested in creating own applications handling statistical data in game.

At this moment here is list of API features that has been discovered:

  • searching players by names
  • searching clans by names
@juzna
juzna / 2012-11-17-intellij-plugins-lexer-tests.md
Created November 17, 2012 19:51
IntelliJ plugins - Lexer + Tests

IntelliJ plugins - Lexer + Tests

We're writing support for Neon language into PhpStorm and we want to have it heavily tested with automated unit tests. First step when processing any programming language is a lexical analyzer or shortly lexer, which takes source code and splits into individual words of the programming language, which are called tokens (actually, also symbols, punctuation and whitespace count as tokens).

JFlex

Because parsing strings manually is tedious and boring, clever people made tools to help us a little bit. Flex is de facto standard language for writing lexers, but we'll use its port to Java called JFlex. In flex files you describe patterns for several types of tokens and associate a piece of code with each. Have a look at flex file for very simple [properties](https://github.com/JetBrains/intellij-community/blob/master/plugins/properties/src/com/intellij/lang/properties/pa