Skip to content

Instantly share code, notes, and snippets.

View imranismail's full-sized avatar

Imran Ismail imranismail

View GitHub Profile
@imranismail
imranismail / autocomplete.php
Last active April 4, 2024 13:15
Laravel And JqueryUI's Autocomplete Plugin
//SearchController.php
public function autocomplete(){
$term = Input::get('term');
$results = array();
$queries = DB::table('users')
->where('first_name', 'LIKE', '%'.$term.'%')
->orWhere('last_name', 'LIKE', '%'.$term.'%')
->take(5)->get();
@imranismail
imranismail / Jquery Ajax And Laravel
Last active August 29, 2015 14:00
Laravel + Jquery Ajax .post
//Javascript
$(function()
{
var BASE_URL = window.location.protocol + '//' + window.location.host;
$("#buttonselector").click(function() {
var data = {
'inputelementname' : $('#inputelementselector').val(),
};
@imranismail
imranismail / railschocolatey.md
Created November 27, 2014 06:09
Installing Rails on Windows using Chocolatey
Error in user YAML: (<unknown>): did not find expected key while parsing a block mapping at line 1 column 1
---
layout: post
title: Installing Ruby and Rails on Windows 8
permalink: installing-ruby-rails-windows-8.html
description: how to install ruby on rails in windows 8
date: 2013-08-26 20:59:40 -07:00
tags: "windows","ruby","rails","chocolatey"
---

Installing Ruby and Rails on Windows 8

@imranismail
imranismail / config.yaml
Created December 6, 2014 07:07
puphpet.com config.yaml for Rails development vagrant box
---
vagrantfile-local:
vm:
box: puphpet/ubuntu1404-x64
box_url: puphpet/ubuntu1404-x64
hostname: ''
memory: '512'
cpus: '1'
chosen_provider: virtualbox
network:
@imranismail
imranismail / anon-llama.rb
Created December 9, 2014 14:16
Anonymooooose Llama
def anonymous_llama(min, max)
for i in min..max
if (i % 3 == 0)
puts "Anonymous"
else
puts i
end
if (i % 5 == 0)
puts "Llama"
@imranismail
imranismail / Dash.js
Last active August 29, 2015 14:11
2D Platformer Experimentation in Unity Game Engine. Visit this link to try it out http://goo.gl/QHT6pp
#pragma strict
var dashButton = "Fire1";
var dashPower : float = 300f;
var facingRight : boolean = false;
function Start () {
}
function Update () {
vagrant box add laravel/homestead
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
hosts_file_additions: true
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
@imranismail
imranismail / gist:dbdeeac4211633d58892
Created April 8, 2015 07:03
WP_Query for gettings multiple post type in multiple taxonomy
get_posts([
'post_type' => ['headline', 'event'],
'numberposts' => 5,
'tax_query' => [
'relation' => 'OR',
['taxonomy' => 'event-category', 'field' => 'slug', 'terms' => 'featured'],
['taxonomy' => 'headline-categories', 'field' => 'slug', 'terms' => 'featured']
],
'order' => 'DESC'
]);
#Insall Ajenti
apt-get update
wget http://repo.ajenti.org/debian/key -O- | apt-key add -
echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list
apt-get update
apt-get install ajenti
service ajenti restart
# Uninstall Apache2
sudo apt-get autoremove && sudo apt-get remove apache2*