Skip to content

Instantly share code, notes, and snippets.

@opnchaudhary
opnchaudhary / phash_install.sh
Last active September 27, 2017 07:06
installing pHash
wget https://github.com/sdepold/pHash/archive/master.zip
unzip master.zip
cd pHash-master
./configure --enable-video-hash=no --enable-audio-hash=no
make
make install
cd bindings/php
./configure --disable-video_hash --disable-audio_hash
@opnchaudhary
opnchaudhary / coutries_with_Iso.php
Last active August 29, 2015 13:59 — forked from vxnick/gist:380904
Array of countries with their iso codes
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
@opnchaudhary
opnchaudhary / bright
Created April 16, 2014 06:36
Bash script to change brightness of Dell Studio 1569 laptop. Permissable values 0 to 4000.
#!/bin/bash
echo $1 | sudo tee /sys/class/backlight/intel_backlight/brightness
@opnchaudhary
opnchaudhary / install-gnustep.sh
Created April 16, 2014 12:05
Installing GnuStep in Ubuntu
sudo apt-get install gnustep gnustep-devel gobjc
@opnchaudhary
opnchaudhary / 503.php
Created May 12, 2014 10:38
503 page for WordPress
<?php
header(“HTTP/1.1 503 Service Temporarily Unavailable”);
header(“status: 503 Service temporarily Unavailable”);
header(“Retry-After: Mon 1 April 2013 00:00 GMT”);
?>
@opnchaudhary
opnchaudhary / ffmpeg-experiment-roku
Created July 15, 2014 09:14
ffmpeg audio/video dolby
Unfortunately, our mpeg demux is having problems parsing multiple audio streams out of a file and selecting the appropriate stream to play. We will enable the parsing of multiple audio streams in the future.
There is a work around you can use today. If you have access to the content, you can strip the excess streams using a transcoding tool like ffmpeg:
% ffmpeg -i MyMultiTracAudio.m4a
....
Duration: 00:59:06.98, start: 0.000000, bitrate: 71 kb/s
Stream #0.0(eng): Audio: aac, 44100 Hz, stereo, s16
Stream #0.1(eng): Data: mp4s / 0x7334706D
Stream #0.2(eng): Data: mp4s / 0x7334706D
[ Handfull things ]
* I use sublime text with vintage mode active, takes your speed to next level.
* Wordpress package for submime text. There is snippet that will help you to create custom post and widget within seconds. https://github.com/purplefish32/sublime-text-2-wordpress
* Sublime linter for checking errors http://www.sublimelinter.com/
* Prepros for compiling sass compressing css and javascript. https://prepros.io/
[ Things to keep in mind ]
* Follow WordPress Coding Standards. http://codex.wordpress.org/WordPress_Coding_Standards
* Use WordPress APIs when neccesarry. http://codex.wordpress.org/WordPress_APIs
* Think about the security. http://codex.wordpress.org/Hardening_WordPress
@opnchaudhary
opnchaudhary / download-file-in-android.txt
Created February 15, 2016 13:19
Function to download file in android
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void downloadFile(Context context, String file, String title, String subtitle) {
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(file));
request.setTitle(title);
request.setDescription(subtitle);
//request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI); //to allow download while using WIFI only
request.allowScanningByMediaScanner();
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
String nameOfFile = URLUtil.guessFileName(file, null, MimeTypeMap.getFileExtensionFromUrl(file));
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, nameOfFile);
@opnchaudhary
opnchaudhary / sources.list
Last active February 20, 2016 17:17
sources.list for Ubuntu 14.04
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
# deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
@opnchaudhary
opnchaudhary / .vimrc
Last active January 14, 2019 05:24
My vim configurations
" Vim Settings
filetype off
filetype plugin indent on
syntax on
set encoding=utf-8
" Pathogen load
execute pathogen#infect()
execute pathogen#helptags()