Skip to content

Instantly share code, notes, and snippets.

View vmware9.compat_mm.patch
--- ./compat_mm.h 2013-03-04 01:36:39.184925478 -0800
+++ ./compat_mm.h 2013-03-04 01:40:37.793728289 -0800
@@ -91,8 +91,9 @@
/*
* In 2.4.10, vmtruncate was changed from returning void to returning int.
+ * In 3.8.0, vmtruncate was removed
*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
View fangol.js
scrollAd: function() {
$(window).scroll(function() {
var top = $('#content').offset().top;
var _top = $('#content').position().top;
var scroll = $(window).scrollTop();
if (scroll > top) {
var data = {
'position': 'fixed',
'top': '20px'
};
View skaj.js
$(document).ready( function() {
$(window).scroll(function() {
var top = $('#content').offset().top;
var _top = $('#content').position().top;
var scroll = $(window).scrollTop();
if (scroll > top) {
var data = {
'position': 'fixed',
'top': '20px'
};
@leafnode
leafnode / gist:9585766
Created Mar 16, 2014
Encrypting files before uploading to backup
View gist:9585766
$ for i in *; do j=`echo "$i" | iconv -f UTF8 -t ASCII//TRANSLIT`; zip -r -0 - "$i" | openssl enc -aes256 -e -k my_secret_key > "$j.zip.enc"; done
View phpconpl
$('.voting-abstract').remove();
$('.voting-item').css( {
'margin': '0 0 10px 0',
'display': 'inline-block',
'width': '177px'
});
$('.voting-title').css( {
'height': '48px',
'overflow': 'hidden',
'white-space': 'nowrap',
View scra.php
<?php
function match($desk, $word) {
if($desk == "") return false;
if($word == "") return true;
# replaced substr with string index access
// $w = substr($word, 0, 1);
$w = $word[0];
$ws = substr($word, 1);
View scra-v003.php
<?php
function match($desk, $word) {
for($i = 0; $i < strlen($word); $i++) {
$pos = strpos($desk, $word[$i]);
if($pos === false) {
$pos = strpos($desk, '*');
if($pos === false) return false;
}
View scra-orig.php
<?php
function match($desk, $word) {
if($desk == "") return false;
if($word == "") return true;
$w = substr($word, 0, 1);
$ws = substr($word, 1);
$pos = strpos($desk, $w);
if($pos !== false) {
View scra-v001b.php
<?php
function match($desk, $word) {
if($desk == "") return false;
if($word == "") return true;
$w = $word[0];
$ws = substr($word, 1);
$pos = strpos($desk, $w);
if($pos !== false) {
View scra.php
<?php
function match($desk, $word) {
for($i = 0; $i < strlen($word); $i++) {
$pos = strpos($desk, $word[$i]);
if($pos === false) {
$pos = strpos($desk, '*');
if($pos === false) return false;
}