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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
// you can also extends CI_Controller for normal CodeIgniter code | |
class Register extends CMS_Controller{ | |
// this is the upload path | |
$upload_path = BASEPATH.'../modules/ssc/assets/upload/'; | |
// this is how to use it | |
public function upload(){ | |
$file = $_FILES['user_file']; |
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
Aptana is a killer editor, the one IDE to rule everything in web realms. It support PHP, Python, Rubby, Python, Javascript, CSS and HTML. It's free, so you can just use it and start to do wonderful things. | |
Base installation : | |
1. Install Eclipse | |
2. Run eclipse | |
3. Go to: Help > Install New Software | |
4. Press Add button | |
5. Add Location "http://download.aptana.com/studio3/plugin/install", name it as "Aptana Plugin" or whatever | |
6. Back to Help > Install New Software (or just close the previous dialog) | |
7. Choose "Aptana Plugin" in Work With input |
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
# create engine | |
from kokoropy.sqlalchemy import create_engine | |
engine = create_engine('sqlite:///non_orm.db', echo=True) | |
# create metadata of table schemas | |
from kokoropy.sqlalchemy import MetaData, Table, Column, Integer, String, ForeignKey | |
metadata = MetaData() | |
users = Table('users', metadata, | |
Column('user_id', Integer, primary_key=True), | |
Column('user_name', 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /forum/ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /forum/index.php [L] | |
</IfModule> |
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
import json | |
# this is your json | |
my_json_data = '{"nick_name" : "Annakin", "family_name" : "Skywalker"}' | |
# this is the decoded json | |
my_data = json.loads(my_json_data) | |
# sql command | |
sql = "INSERT INTO tbl(nick_name, family_name) VALUES('"+my_data["nick_name"]+"', '"+my_data["family_name"]+"')" |
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
from sqlalchemy import Column, Integer, String, create_engine | |
from sqlalchemy.orm import scoped_session, sessionmaker | |
from sqlalchemy.ext.declarative import declarative_base | |
############################### SQL ALCHEMY SCRIPT #################################### | |
# create Base | |
Base = declarative_base() | |
# create Pokemon class |
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
from sqlalchemy.ext.declarative import declarative_base, declared_attr | |
from sqlalchemy import Column, Integer, String | |
Base = declarative_base() | |
class CustomBase(Base): | |
__abstract__ = True | |
def __init__(self): | |
print "Hello world" |
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
python rossian.py scaffold-crud coba orang nama:String-50 alamat:String-50 ayah:orang:manytoone ibu:orang:manytoone teman:orang:onetomany anak:orang:onetomany jurus:jurus:onetomany pekerjaan:pekerjaan:manytoone hobi:hobi:manytomany tanggal_lahir:Date |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func write(n int){ | |
for i := 0; i<100; i++ { |
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
package prof_04_01; | |
class Node{ | |
int data; | |
Node next; | |
Node prev; | |
public Node(int new_data){ | |
data = new_data; | |
} | |
} |
OlderNewer