Skip to content

Instantly share code, notes, and snippets.

View Ikke's full-sized avatar

Kevin Daudt Ikke

  • Netherlands
  • 04:26 (UTC +02:00)
View GitHub Profile
git-test-conflict :: (master*) » git mergetool ~/tmp/git-test-conflict
Merging:
foo
Normal merge conflict for 'foo':
{local}: modified file
{remote}: modified file
Hit return to start merge resolution tool (vimdiff):
4 files to edit
@Ikke
Ikke / sys
Created March 4, 2014 19:28
Shortcuts for systemctl
#!/bin/bash
sys="sudo /usr/bin/systemctl"
case "$1" in
s) shift 1
$sys status $@
;;
o) shift 1
>>> def test_loop(previous_quarter, quarter_index, max_quarter):
... while previous_quarter % max_quarter != quarter_index:
... print(previous_quarter % max_quarter)
... previous_quarter+=1
...
>>>
>>> test_loop(10,10,20)
>>> test_loop(10,11,20)
10
>>> test_loop(10,12,20)
@Ikke
Ikke / test.rb
Last active August 29, 2015 13:56
def test_loop(previous_quarter, quarter_index, max_quarter) do
while(previous_quarter % max_quarter != quarter_index) do
puts(quarter_index)
quarter_index += 1
end
end
>>> current = 89
>>> new = 5
>>> while current % 96 != new:
... print("Sending: " + str(current % 96))
... current += 1
...
Sending: 89
Sending: 90
Sending: 91
Sending: 92
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
@Ikke
Ikke / gist:7681123
Created November 27, 2013 18:54
Minimal repo with 1 commit
.git
├── HEAD
├── index
├── objects
│   ├── 4d
│   │   └── 5fcadc293a348e88f777dc0920f11e7d71441c
│   ├── da
│   │   └── 121d9970671b2628e3b813d3ab27ef1e5f4a49
│   └── e6
│   └── 9de29bb2d1d6434b8b29ae775ad8c2e48c5391
munin-node:
pkg:
- installed:
- names:
- munin-node
- munin-plugins-extra
- liblwp-useragent-determined-perl
- libcache-cache-per
service:
- running
@Ikke
Ikke / top.sls
Created October 15, 2013 21:05
this is in /srv/salt/
base:
'*':
- user
@Ikke
Ikke / gist:6962286
Last active December 25, 2015 10:29
Transaction wrapper (pseudocode)
<?php
class Transaction
{
protected $db;
public function __construct($db)
{
$this->db = $db
}