This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MY_Security extends CI_Security{ | |
//overriding the normal csrf_verify, this gets automatically called in the Input library's constructor | |
//verifying on POST and PUT and DELETE | |
public function csrf_verify(){ | |
//attach to global POST variable | |
//this will catch any method POST, PUT, DELETE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('BASEPATH') OR exit('No direct script access allowed'); | |
/** | |
* Extend the Security Class. Use this if u re using CSRF protection | |
* @updated by budy k | |
* @link https://gist.github.com/codetrash/6e12ce0c559ea4eab7c0927fd3b7cdca | |
* extend CI 3 core security library | |
* Create a file named MY_Security.php inside /application/core/ | |
*/ | |
class MY_Security extends CI_Security |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//JWT Helper.. | |
.service('jwtHelper', function() { | |
this.urlBase64Decode = function(str) { | |
var output = str.replace(/-/g, '+').replace(/_/g, '/'); | |
switch (output.length % 4) { | |
case 0: { break; } | |
case 2: { output += '=='; break; } | |
case 3: { output += '='; break; } | |
default: { | |
throw 'Illegal base64url string!'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#tutorial (INA): http://teknosains.com/i/tutorial-me-resize-puluhan-ribu-gambar-sekaligus-dengan-python-ubuntu | |
#tutorial (EN): https://dzone.com/articles/resize-thousands-images-python | |
import PIL | |
from PIL import Image | |
import os | |
import sys | |
def readf(): | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# reference => http://www.puffinwarellc.com/index.php/news-and-articles/articles/33.html | |
from numpy import zeros | |
from scipy.linalg import svd | |
from math import log # needed for TFIDF | |
from numpy import asarray, sum | |
titles = ["The Neatest Little Guide to Stock Market Investing", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('BASEPATH') or exit('No direct script access allowed'); | |
/** | |
* Extending The Controller | |
* | |
* @author budy k | |
* | |
*/ | |
/* load the MX_Loader class */ | |
require APPPATH."third_party/MX/Controller.php"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('BASEPATH') or exit('No direct script access allowed'); | |
/** | |
* Home class | |
* Check /core/MY_Controller | |
* | |
* @author budy k | |
* @link www.facebook.com/teknosains | |
* @link www.teknosains.com | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Load above the fold css--> | |
<style><?php $this->view('layouts/css');?></style> | |
<!--Have additional CSS? load here --> | |
<?php if (isset($css)) { foreach($css as $cx) { ?> | |
<link rel="stylesheet" href="<?php echo resource_url($cx);?>"> | |
<?php } }?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class My_class extends MY_Controller | |
{ | |
/* | |
* Show Create Post interface. | |
* Include any library you want | |
*/ | |
public function create_post() | |
{ | |
$data = [ |
OlderNewer