Skip to content

Instantly share code, notes, and snippets.

@dcode
dcode / GitHub Flavored Asciidoc (GFA).adoc
Last active May 26, 2025 06:38
Demo of some useful tips for using Asciidoc on GitHub

GitHub Flavored Asciidoc (GFA)

# Building just clang-9.0 for creduce.
execute_process(
COMMAND "grep" "^processor" "/proc/cpuinfo"
COMMAND "wc" "-l"
COMMAND "tr" "-d" "'\n'"
OUTPUT_VARIABLE ncpu)
message("Building with ${ncpu} cpus")
set(LLVM_PARALLEL_COMPILE_JOBS ${ncpu} CACHE STRING "")
@jpillora
jpillora / sshd.go
Last active June 16, 2025 14:55
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@koter84
koter84 / travis_secure_private_key.sh
Last active April 18, 2017 00:36
Create a private key-pair and encrypt it for use in .travis.yml with working code for decrypting it on both linux and osx builders
#!/bin/bash
ssh-keygen -t rsa -N "" -C travis -f ./travis_key
# i only tested the encrypting on Linux.
# on mac you need gsplit instead of split, but the rest should be mostly the same
#
# decryption works on both linux and mac travis-workers
echo "encrypt private"
@olamy
olamy / gist:3736092
Created September 17, 2012 07:56
Tip for Maven Builds faster
A tip for faster build (copy file really faster) with plexus-utils 3.0.7
<properties>
<plexusUtilsPluginsVersion>3.0.7</plexusUtilsPluginsVersion>
</properties>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<dependencies>
root :
<sonar:sonar_project key="foo" version="1.1">
<modules>
<path location="one"/>
<path location="two"/>
</modules>
</sonar:sonar_project>
modules :
@zbyhoo
zbyhoo / gitp2svnp.rb
Last active December 23, 2016 10:37
Simple script converting git patch file into tortoise merge compatible format. Usage: gitp2svnp.rb <git_patch_file>
#!/usr/bin/ruby
if ARGV.length != 1
puts "usage: git2svn <file_name>"
puts " file_name - git patch file name"
exit
end
separator = "\n===================================================================\n"
new_file = false
" Git rebase helper for:
" git rebase --interactive
"
" L - view commit log
" p - pick
" e - edit
" s - squash
" r - reword
" D - delete
"
@kneath
kneath / ._what.md
Created December 4, 2009 18:23
Badass git pull alias (up) to show commit log that just got pulled in addition to changes

Badass git pull alternative

Add this little snippet to your ~/.gitconfig and it amps up your git pull by means of git up

  1. Adds in a list of the commits you're pulling down
  2. Auto-prunes remote branches
  3. Defaults to pull --rebase - gets rid of unnecessary merge commits. If you don't know what rebase does, this is probably safe for you. If you know what rebase does, you should know where this will not be safe for you.

Scott Chacon and Ryan Tomayko basically figured out how to do this and I am stealing all of the credit.