Skip to content

Instantly share code, notes, and snippets.

View DarkMukke's full-sized avatar

Mukke DarkMukke

View GitHub Profile
@yevrah
yevrah / Upgrade vim
Last active September 25, 2023 05:11
Update to Vim8 on Centos 7
################################################################################
# Method 1: Install using rpm packages (credit to DarkMukke)
#
rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7
# WARNING: removing vim-minimal uninstalls `sudo` if you skip the second step
# make sure to at least run `yum install sudo`
yum -y remove vim-minimal vim-common vim-enhanced
@jamarparris
jamarparris / Generate Mongo Object ID in PostGres
Last active March 20, 2024 00:04
Create ObjectIds in PostGres following the MongoDB semantics. Very similar to the Instagram approach linked below.http://docs.mongodb.org/manual/reference/object-id/http://instagram-engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram
The MIT License (MIT)
Copyright (c) 2013 Jamar Parris
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S
@ozh
ozh / gist:5439013
Created April 22, 2013 22:10
Crontab template
MAILTO=""
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed
# * * * * * command --arg1 --arg2 file1 file2 2>&1
@drocamor
drocamor / json-beautifier.sh
Created February 22, 2013 15:13
Uses Python to clean up JSON
#!/bin/bash
TMPFILE=`mktemp /tmp/prettyjson.XXXXXX` || exit 1
python -mjson.tool $1 > $TMPFILE || exit 1
mv $TMPFILE $1 || exit 1
@masnun
masnun / annotations.php
Created August 12, 2012 15:54
Demonstration of Doctrine Annotation Reader
<?php
/**
*@Annotation
*/
class AnnotatedDescription
{
public $value;
public $type;
public $desc;
}
@cdzombak
cdzombak / README.md
Created September 28, 2010 21:43
recursive ksort function for PHP