Skip to content

Instantly share code, notes, and snippets.

View tediscript's full-sized avatar
🎯
Focusing

Alfredo Pareto tediscript

🎯
Focusing
View GitHub Profile
@tediscript
tediscript / hello.php
Created July 2, 2011 12:07
Hello World!
<?php
echo "Hello World!";
?>
@tediscript
tediscript / endec.php
Created July 9, 2011 02:20
Ecnryption
<?php
class Endec {
public function encrypt($sData, $sKey='mysecretkey') {
$sResult = '';
for ($i = 0; $i < strlen($sData); $i++) {
$sChar = substr($sData, $i, 1);
$sKeyChar = substr($sKey, ($i % strlen($sKey)) - 1, 1);
$sChar = chr(ord($sChar) + ord($sKeyChar));
@tediscript
tediscript / authlib.php
Created November 24, 2011 04:36
CodeIgniter Auth Library
<?php
/**
* Description of authlib
*
* @author tediscript
*/
class Authlib {
function __construct() {
@tediscript
tediscript / Widget.php
Created November 24, 2011 04:38
CodeIgniter Widget
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Widget {
static $a = array();
function Widget() {
@tediscript
tediscript / templates.php
Created November 24, 2011 04:39
CodeIgniter Templates (themes)
<?php
/**
* Description of themes
*
* @author tediscript
*/
class Templates {
function __construct() {
@tediscript
tediscript / redbean.php
Created November 24, 2011 04:40
CodeIgniter RedBean Loader
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class redbean {
function __construct() {
include(APPPATH . '/config/database.php');
@tediscript
tediscript / mimelib.php
Created November 24, 2011 04:42
MIME lib
<?php
/**
* Description of mimelib
*
* @author tediscript
*/
class mimelib {
public function getmime($fileName = "jajal.txt") {
@tediscript
tediscript / hide.html
Created February 13, 2012 08:39
hide show attribute
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#tombol').hide();
$('#input-akhir').click(function(){
$('#tombol').show();
});
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#input-akhir').click(function(){
$('#tombol').attr('disabled', false);
});
});
</script>
@tediscript
tediscript / restlerwrapper.js
Created March 1, 2012 10:17
Restler wrapper
var sys = require('util'),
rest = require('restler');
exports.hello = function() {
return 'hae';
};
exports.get = function(url, callback){
rest.get(url).on('complete', function(result) {
callback(result);