This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @c1 = PI()/180, | |
@c2 = PI()/360, | |
@r = 6378137, | |
@lat1 = ?, | |
@lng1 = ?; | |
SELECT latitude, longitude, distance | |
FROM ( | |
SELECT *, | |
@lat2 := latitude, | |
@lng2 := longitude, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//error_reporting(0); | |
$text = ("കണ്ണൂർ, പപ്പൻ, പൂച്ച"); | |
$fontSize = "30"; | |
$width = '300'; | |
$s = new CairoImageSurface(CairoFormat::ARGB32, $width, 60); | |
$c = new CairoContext($s); | |
/* Set the background*/ | |
$c->setSourceRGB(1,1,.27); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Description | |
Count all pages within a category and its sub-categories recursively | |
@author Junaid | |
""" | |
import wikipedia | |
import catlib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
== Interproject links == | |
<pre> */ | |
function Projectlinks() { | |
var elements = new Array(); | |
var spans = document.getElementsByTagName('span'); | |
// filter for projectlinks | |
for (var i=0, j=0; i<spans.length; i++) { | |
if (spans[i].className == 'interProject') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
@NAME = "Malayalam Mozhi" | |
@DESCRIPTION = "Wikipedia a Mozhi" | |
@TRACK_CAPSLOCK = "TRUE" | |
@EAT_ALL_UNUSED_KEYS = "FALSE" | |
@US_LAYOUT_BASED = "TRUE" | |
@Icon = "ma.png" | |
*/ | |
// author: Junaid (http://junaidpv.in) | |
// version: 1.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
@NAME = "Malayalam InScript 5.0" | |
@DESCRIPTION = "Malayalam InScript Layout" | |
@TRACK_CAPSLOCK = "TRUE" | |
@EAT_ALL_UNUSED_KEYS = "FALSE" | |
@US_LAYOUT_BASED = "TRUE" | |
@Icon = "i.png" | |
*/ | |
// author: Junaid (http://junaidpv.in) | |
// version: 0.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/sites/all/modules/views/plugins/views_plugin_query_default.inc b/sites/all/modules/views/plugins/views_plugin_query_default.inc | |
index 39e8061..1a34443 100644 | |
--- a/sites/all/modules/views/plugins/views_plugin_query_default.inc | |
+++ b/sites/all/modules/views/plugins/views_plugin_query_default.inc | |
@@ -1393,6 +1393,19 @@ class views_plugin_query_default extends views_plugin_query { | |
$query->range($offset, $limit); | |
} | |
+ $query_string = (string)$query; | |
+ $query_string = str_replace('{', '', $query_string); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Bootstrap | |
// Change chdir to the full path of your Drupal root | |
define('DRUPAL_ROOT', getcwd()); | |
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF']; | |
$_SERVER['REMOTE_ADDR'] = "127.0.0.1"; | |
$_SERVER['REQUEST_METHOD'] = NULL; | |
require_once './includes/bootstrap.inc'; | |
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in */ | |
do | |
echo "Opening directory $i..." | |
cd $i | |
git pull | |
cd ../ | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$path="../ctest"; | |
$zip = new ZipArchive; | |
$zip->open('../ctest.zip', ZipArchive::CREATE); | |
if (false !== ($dir = opendir($path))) { | |
while (false !== ($file = readdir($dir))) { | |
if ($file != '.' && $file != '..') { | |
$zip->addFile($path.DIRECTORY_SEPARATOR.$file); | |
//delete if need |