Skip to content

Instantly share code, notes, and snippets.

@githubutilities
githubutilities / main.c
Created August 23, 2015 05:45
c infinite parameter
#include <stdio.h>
#include <stdarg.h>
// calculate the sum until -1 is met
int sum( int first, ... ) {
int ret = 0, val = first;
va_list marker;
va_start(marker, first);
while ( -1 != val ) {
@githubutilities
githubutilities / Django-Log.md
Last active August 29, 2015 14:27
Django Log

Django in apache mod_wsgi

use sys.path.append to fix the compatiability with apache mod_wsgi

import os
import sys

# append path for the compatiability of apache2 mod_wsgi
sys.path.append('/var/www/html')
@githubutilities
githubutilities / git-push-to-deploy.md
Last active November 4, 2015 12:28
Git push to deploy

Git Push to Deploy

  • init git server using git init --bare

  • edit hooks/post-receive, remember to chmod +x post-receive

#!/usr/bin/env ruby
# post-receive
@githubutilities
githubutilities / Linux-permission-management.md
Last active August 10, 2023 22:14
Linux user-group management

Linux permission management

  • chown
  • chgrp
  • chmod

User and group management

User

@githubutilities
githubutilities / MySQL CheatSheet.md
Last active September 19, 2015 14:13
MySQL CheatSheet

MySQL CheatSheet

MySQL run on external ip address

change mysql config file /etc/mysql/my.cnf

bind-address		= 0.0.0.0
@githubutilities
githubutilities / Screen Keyboard Recording.md
Created August 29, 2015 13:12
Screen Keyboard Recording
@githubutilities
githubutilities / iOS-private-framework.md
Last active March 2, 2023 06:22
iOS private framework

UIAnimation delay not working in animateWithDuration:delay:options:animations:completion:

Try to work around with dispatch_after() or performSelector:withDelay:.