Skip to content

Instantly share code, notes, and snippets.

View tinyCoder32's full-sized avatar

Rami tinyCoder32

View GitHub Profile
@csanz
csanz / encrypt_decrypt.js
Created August 30, 2011 16:06
Simple String Encryption & Decryption with Node.js
function encrypt(text){
var cipher = crypto.createCipher('aes-256-cbc','d6F3Efeq')
var crypted = cipher.update(text,'utf8','hex')
crypted += cipher.final('hex');
return crypted;
}
function decrypt(text){
var decipher = crypto.createDecipher('aes-256-cbc','d6F3Efeq')
var dec = decipher.update(text,'hex','utf8')
@sbrajesh
sbrajesh / hide-subscribers.php
Last active May 22, 2024 11:37
Hide Subscriber Users from BuddyPress member Directory
<?php
/**
* Excludes users from BuddyPress Members list.
*
* @param string $qs Query string.
* @param string $object object loop identikfier.
*
* @return string
*/
function bpdev_exclude_users( $qs = false, $object = false ) {
@zekizeki
zekizeki / arabic_transliteration.php
Created July 9, 2012 10:28
A php script to provide simple english->arabic arabic->english transliteration
<?php
/*
* Created on 05-Jul-2006
* rob.s.smart@gmail.com
* Translator class calls external machine translation component
*/
class Phonetics
{
@thomseddon
thomseddon / gist:3511330
Last active March 8, 2023 03:39
AngularJS byte format filter
app.filter('bytes', function() {
return function(bytes, precision) {
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
}
});
@anointed
anointed / multi-ipn.php
Created September 30, 2012 02:42
Paypal multiple IPN's
<?php
/*
* This is a PayPal IPN (Instant Payment Notification) broadcaster
* Since PayPal does not provide any straightforward way to add
* multiple IPN listeners we'll have to create a central IPN
* listener that will broadcast (or filter and dispatch) Instant
* Payment Notifications to different destinations (IPN listeners)
*
* http://codeseekah.com/2012/02/11/how-to-setup-multiple-ipn-receivers-in-paypal/
*
@spigotdesign
spigotdesign / user-profile-picture.php
Last active September 26, 2022 04:38
Add WordPress image uploader to user profile.
/*
* Add custom user profile information
*
*/
add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );
function my_show_extra_profile_fields( $user ) { ?>
@achoukah
achoukah / blank-html-page.html
Last active May 23, 2024 14:45
html blank page
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="description" content="Webpage description goes here" />
<meta charset="utf-8">
<title>Change_me</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="">
<link rel="stylesheet" href="css/style.css">
@juanpujol
juanpujol / humanize-constant-filter.js
Created June 22, 2013 01:01
AngularJS Filter to transform a constant like strings to human text. i.e. "SUPPORT_SYSTEM" => "Support system"
angular.module('app').filter('humanizeConstant', function(){
return function(text) {
if(text) {
var string = text.split("_").join(" ").toLowerCase();
var string = string.charAt(0).toUpperCase() + string.slice(1);
return string
};
};
});
@smokinjoe
smokinjoe / gist:5861897
Created June 25, 2013 20:06
Simple way to create a 'bounce' effect with css's keyframes
.myBounceDiv {
-moz-animation:bounce .40s linear;
-webkit-animation:bounce .40s linear;
}
@-moz-keyframes bounce {
0%{ -moz-transform:scale(0); opacity:0;}
50%{ -moz-transform:scale(1.3); opacity:0.4; }
75%{ -moz-transform:scale(0.9); opacity:0.7;}
100%{ -moz-transform:scale(1); opacity:1;}
@victorb
victorb / app.js
Created September 24, 2013 16:37
Easy AngularJS Directive for Google Places Autocomplete
var myApp = angular.module('myApp', []);
myApp.directive('googleplace', function() {
return {
require: 'ngModel',
link: function(scope, element, attrs, model) {
var options = {
types: [],
componentRestrictions: {}
};