Skip to content

Instantly share code, notes, and snippets.

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'
};
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'
};
@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.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-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-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-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 keybase.md

Keybase proof

I hereby claim:

  • I am leafnode on github.
  • I am leafnode (https://keybase.io/leafnode) on keybase.
  • I have a public key whose fingerprint is 7D4C 9FA5 8EA8 FF1B CC0C F361 7D7E 27A9 3ABC B738

To claim this, I am signing this object: