Skip to content

Instantly share code, notes, and snippets.

View ttys3's full-sized avatar
💭
sad, ttyS0 has been taken by other user

ttys3

💭
sad, ttyS0 has been taken by other user
View GitHub Profile
@colinmollenhour
colinmollenhour / post-receive-redmine.sh
Last active September 1, 2023 21:56
gitolite update hooks to reject CRLF line endings and require formatted commit messages
#!/bin/bash
#
# see https://github.com/kahseng/redmine_gitolite_hook/blob/master/README.rdoc
#
# The "post-receive" script is run after receive-pack has accepted a pack
# and the repository has been updated. It is passed arguments in through
# stdin in the form
# <oldrev> <newrev> <refname>
# For example:
# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
@katanacrimson
katanacrimson / gist:1515305
Created December 23, 2011 20:40
why phpbb failed
why phpbb has failed the open source movement
in response to the daydreaming present in http://www.phpbb.com/community/viewtopic.php?f=64&t=2143698
note: this is from the standpoint of the everyday admin, running 3.0.x - changes already patched into 3.1.x are not taken into consideration as they are not readily available for public use. if you want pending changes considered, get off your ass and get a release of 3.1.x out.
---
issues
- contributing
@jappy
jappy / dos2unix.sh
Created March 10, 2012 18:03
Shell script to convert files with CRLF to LF (Mac/Linux)
#! /bin/sh
for x
do
echo "Converting $x"
tr -d '\015' < "$x" > "tmp.$x"
mv "tmp.$x" "$x"
done
@Victa
Victa / gist:2169221
Created March 23, 2012 10:08
Force Hardware Acceleration in WebKit with translate3d
/* warp speed ahead */
.animClass {
-webkit-transform: translate3d(0, 0, 0);
/* more specific animation properties here */
}
/*
The use of translate3d pushes CSS animations into hardware acceleration.
Even if you're looking to do a basic 2d translation, use translate3d for more power!
If your animation is still flickering after switching to the transform above,
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@JimWestergren
JimWestergren / index-with-redis.php
Last active February 11, 2023 18:28
Redis as a Frontend Cache for WordPress
<?php
/*
Author: Jim Westergren & Jeedo Aquino
File: index-with-redis.php
Updated: 2012-10-25
This is a redis caching system for wordpress.
see more here: www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/
@ck-on
ck-on / ocp.php
Last active May 18, 2024 22:35
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@XVilka
XVilka / TrueColour.md
Last active May 26, 2024 22:50
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@vgerak
vgerak / statvfs-df.c
Created January 21, 2014 12:25
Get disk usage with statvfs()
#include <stdio.h>
#include <sys/statvfs.h>
int main(int argc, const char *argv[])
{
const unsigned int GB = (1024 * 1024) * 1024;
struct statvfs buffer;
int ret = statvfs(argv[1], &buffer);
@lemiorhan
lemiorhan / post-receive
Last active February 8, 2023 10:06
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then