Skip to content

Instantly share code, notes, and snippets.

View anytizer's full-sized avatar

Bimal Poudel anytizer

View GitHub Profile
@anytizer
anytizer / screen-sizes.txt
Created March 7, 2014 20:08
Screen sizes (websites)
http://www.websitedimensions.com/
http://www.apple.com/iphone/compare/
http://osxdaily.com/2009/09/26/iphone-screen-resolution-is-480-x-320-pixels/
@anytizer
anytizer / copyrights.php
Created March 9, 2014 09:15
copyrights
<?php echo date('Y'); ?>
@anytizer
anytizer / pre-commit.sh
Created March 10, 2014 09:07
Pre-Commit script
#!/bin/sh
# http://blog.grimsy.net/2008/07/a-few-svn-pre-commit-hooks/
REPOS="$1"
TXN="$2"
# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
SVNLOOKOK=1
$SVNLOOK log -t "$TXN" "$REPOS" | \
@anytizer
anytizer / post-commit.sh
Created March 10, 2014 09:08
Post Commit
#!/bin/sh
REPOS="$1"
REV="$2"
svn update --force --quiet /PATH/
wget --quiet http://SERVER/commit/?project=PROJECT&revision=${REV}&repos=${REPOS} > /dev/null
@anytizer
anytizer / tables-diff-sql.php
Created March 10, 2014 09:49
Differences in databases
<?php
mysql_connect('S.ERV.ER.IP', 'root', 'PASSWORD');
$target='DATABASE_LOCAL';
$source='DATABASE_LIVE';
$schema_listing_sql = "
SELECT
TABLE_SCHEMA `database`,
TABLE_NAME `table`,
@anytizer
anytizer / grant.sql
Created March 11, 2014 06:55
Grant and make SQL examples
GRANT ALL ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD';
GRANT ALL ON *.* TO 'USERNAME'@'localhost' IDENTIFIED BY 'PASSWORD';
@anytizer
anytizer / wp-pagenum.sh
Created March 12, 2014 12:17
contents matcher - for malwares
find . -iname '*.php' -exec grep -li 'Whats' {} \;
@anytizer
anytizer / latest-modified.sh
Created March 12, 2014 13:34
latest modified files
find . -type f -iname '*.php' -mtime -3
@anytizer
anytizer / timezones.php
Created March 13, 2014 08:41
Server timezone difference
mysql_query('SET time_zone = "+0:00";');
date_default_timezone_set('Europe/London');
@anytizer
anytizer / header.php
Created March 15, 2014 09:34
HTTP User Agent
<?php echo $_SERVER['HTTP_USER_AGENT']; ?>