Skip to content

Instantly share code, notes, and snippets.

View Anticom's full-sized avatar
:octocat:
octocode

Timo Mühlbach Anticom

:octocat:
octocode
View GitHub Profile

Keybase proof

I hereby claim:

  • I am anticom on github.
  • I am toganticom (https://keybase.io/toganticom) on keybase.
  • I have a public key ASDD8ZD5K89X-wpluJcONBQCBnC430by2OZCyo076n9s8Qo

To claim this, I am signing this object:

@Anticom
Anticom / Dockerfile
Created December 15, 2019 14:43
nodegit alpine issue
FROM node:lts-alpine
WORKDIR /usr/src/app
COPY . .
RUN npm ci
CMD ["npm", "start"]
@Anticom
Anticom / from.php
Last active February 9, 2019 02:06
refactor extract boolean expression example (PHP)
<?php
class MobilePhone {
// example state
$state = [
'connectedToWifi' => true,
'connectedToCelular' => false,
];
public function isOnlineMsg() {
if($this->state['connectedToWifi'] || $this->state['cellular']) return 'yes';
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
@Component({
selector: 'app-search-bar',
template: `
<md-input-container class="search-bar">
<input mdInput #searchquery placeholder="Search">
<span md-prefix>
<i class="material-icons app-input-icon">search</i>&nbsp;
</span>
@Anticom
Anticom / Foo.java
Last active December 27, 2016 21:50
public class Foo {
//...
private List<Phrase> breed(List<Phrase> currentPopulation) {
List<Phrase> newPopulation = currentPopulation.subList(31, 95);
List<Phrase> breedingPool = new ArrayList<>(newPopulation);
//pick two random species
Random r = new Random();
for(int i = 0; i < 32; i++) {
""" See: https://github.com/mgedmin/dotvim/blob/master/vimrc
" Backup files {{{2
set backup " make backups
set backupdir=~/tmp " but don't clutter $PWD with them
if $USER == "root"
" 'sudo vi' on certain machines cannot write to ~/tmp (NFS root-squash)
set backupdir=/root/tmp
endif
@Anticom
Anticom / .gitconfig
Created December 19, 2016 13:31
My git setup
cat ~/.gitconfig
[user]
name = XXXXXXX
email = XXXXXXX@XXXXXX
[github]
user = Anticom
[core]
excludesfile = ~/.gitignore_global
package eu.anticom.model.opensearch;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import eu.anticom.serializer.ContactDeserializer;
import eu.anticom.serializer.ContactSerializer;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import java.io.UnsupportedEncodingException;
@Anticom
Anticom / awk.awk
Last active February 29, 2016 09:43
#!/usr/bin/awk -f
BEGIN{
}
#match splits, need to print the line before aswell
/.*\/([0-9a-f]{7}\W)?.*$/{
print thelinebefore
print $0
}
#match merges, need to print the line after aswell
/.*\\([0-9a-f]{7}\W)?.*$/{
# http://durdn.com/blog/2012/11/22/must-have-git-aliases-advanced-examples/
[alias]
#...
#from pretty (verbose) to less verbose
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg3 = log --color --graph --pretty=format:'%C(bold blue)%h%Creset -%C(bold yellow)%d%Creset %s %C(bold green)(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
#default
lg = !"git lg1"