Skip to content

Instantly share code, notes, and snippets.

View ottok's full-sized avatar

Otto Kekäläinen ottok

View GitHub Profile
@ottok
ottok / gist:fecaeb2f501654df33b34393b3214855
Created May 17, 2017 07:59
koodiasuomesta teeman korjauksia
diff -ru 20150814_sage/assets/scripts/jquery.ba-bbq.js /data/backups/data/wordpress/htdocs/wp-content/themes/20150814_sage/assets/scripts/jquery.ba-bbq.js
--- 20150814_sage/assets/scripts/jquery.ba-bbq.js 2017-05-17 10:06:56.131747047 +0300
+++ /data/backups/data/wordpress/htdocs/wp-content/themes/20150814_sage/assets/scripts/jquery.ba-bbq.js 2017-05-02 14:19:25.000000000 +0300
@@ -975,10 +975,10 @@
// IE6/7 specifically need some special love when it comes to back-button
// support, so let's do a little browser sniffing..
- //browser = $.browser,
+ browser = $.browser,
mode = document.documentMode,
Author: Vicențiu Ciorbaru <[email protected]> 2016-09-19 21:45:30
Add a counter for the number of select statements using window functions
The counter is available via SHOW [GLOBAL] STATUS and will be reported
by the feedback plugin.
-------------------------------- sql/mysqld.cc --------------------------------
index cf9e99b..a5cfd05 100644
@@ -8411,6 +8411,7 @@ int show_threadpool_idle_threads(THD *thd, SHOW_VAR *var, char *buff,
--- post.class.php 2015-09-14 10:00:04.381184100 +0300
+++ post.class.php.orig 2015-09-14 09:59:50.324801733 +0300
@@ -640,7 +640,7 @@
}
if(isset($info_meta['img_link']) && strlen($info_meta['img_link'])){
- $start_link = '<a href="'.$info_meta['img_link'].'" target="_self" ">';
+ $start_link = '<a href="'.$info_meta['img_link'].' target="_self" ">';
$end_link = '</a>';
}else{
@ottok
ottok / pre-commit
Created May 9, 2015 09:06
Example of a .git/hooks/pre-commit for PHP developers
#!/bin/bash
for FILE in $(git diff --cached --name-only); do
if [[ "$FILE" =~ \.php$ ]]; then
php -l "$FILE" 1> /dev/null
if [[ $? -ne 0 ]]; then
echo -e "\e[1;33mAborting commit: PHP code contains syntax errors\e[0m" >&2
exit 1
fi
fi
### Keybase proof
I hereby claim:
* I am ottok on github.
* I am ottok (https://keybase.io/ottok) on keybase.
* I have a public key whose fingerprint is 99B4 52B1 1F3C 74C3 B453 E46F BED8 449F CEE8 DA88
To claim this, I am signing this object:
@ottok
ottok / gist:5497666
Created May 1, 2013 19:25
JavaScript and C# comparison
class foo {
protected var findMe = 100;
}
class bar extends foo {
class baz extends foo {
public function Constructor() {
console.log("baz: " + findMe);
}
}