Skip to content

Instantly share code, notes, and snippets.

View pi0's full-sized avatar

Pooya Parsa pi0

View GitHub Profile
@pi0
pi0 / gist:11053969
Last active August 29, 2015 14:00
SQL
create table students ( f_name string , l_name string , id int , score float , status string ) ;
insert into students parameter ( f_name , l_name , id , score , status ) values ( ali , irani , 45 , 20.0 , passed ) ;
insert into students parameter ( f_name , l_name , id , score , status ) values ( pooya , parsa , 48 , 15.6 , passed ) ;
insert into students parameter ( f_name , l_name , id , score , status ) values ( masoud , bonabi , 12 , 17.3 , passed ) ;
insert into students parameter ( f_name , l_name , id , score , status ) values ( fellan , bahman , 1 , 9.9 , failed ) ;
update from students set status = pending ;
update from students set status = special where id = 12 ;
@pi0
pi0 / dumper.java
Created May 13, 2014 14:08
Dump[ed] java swing icons
for(Object o:UIManager.getLookAndFeelDefaults().keySet())
if(UIManager.getDefaults().get(o) instanceof Icon)
System.out.println(o);
@pi0
pi0 / 2048.c
Last active August 29, 2015 14:01
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <conio.h>
static int Tiles[16];
int NoSpaceAvailable(void);
int SpaceAvailable(void);
Wednesday, August 24, 2011
Configure PhpStorm to Auto-complete CakePHP Models, Views, and Controllers
After playing around a bit today I finally figured out how to get PhpStorm to auto-complete methods for models and controllers. Here's what you need to do.
Removing Multiple Definitions
First, let's tackle the multiple definitions problem that we see below.
<?php
/**
* CakePHP Helper Code Completion
* @author junichi11
*
* install NetBeans 7.0 && cakephp-netbeans plugin
* http://netbeans.org
* https://github.com/evilbloodydemon/cakephp-netbeans/tree/autocomplete
* /path/to/yourproject/nbproject/cake_helper_code_completion.php
*
#include<stdio.h>
#define MAX_SIZE 20
void print_sparse(int b[MAX_SIZE][3]);
void read_sparse(int b[MAX_SIZE][3]);
void multiply(int b1[MAX_SIZE][3],int b2[MAX_SIZE][3],int b3[MAX_SIZE][3]);
void Fast_transpose(int B1[MAX_SIZE][3],int B2[MAX_SIZE][3]);
@pi0
pi0 / AI Game
Created October 19, 2014 19:27
GameClassDiagram
{
class Entity
{
class Unit
{
class Human
class Robot
{
class SoldierBot
@pi0
pi0 / ConsoleSinPlot.c
Created November 10, 2014 18:51
ConsoleSinPlot.c
#include <stdio.h>
#include <math.h>
#include <conio.h>
int main()
{
int i, j, val;
for (j = 0; j < 25; j++) {
-32
72 u
80 d
75 l
77 r
@pi0
pi0 / OS
Last active August 29, 2015 14:13
#!/bin/bash
#trap USR1 signal
function on_usr1() {
read line < `cat my_conf`
echo $line > /dev/tty2
echo "Got SIGUSR1 !"
}