Skip to content

Instantly share code, notes, and snippets.

@bilalq
bilalq / .ideavimrc
Created June 4, 2014 21:08
My .ideavimrc
inoremap jj <Esc>`^
set ignorecase
set smartcase
set scrolloff=3
set history=1000
@bilalq
bilalq / ie8_$q.sjs
Created May 17, 2014 09:45
Sweet $q Promise methods for IE8
/**
* Macros to make $q Promises better in IE8
*
* Tested with v0.6.0 of sweet.js
*/
/**
* These operator macros will take `.catch` and `.finally` method invocations
* and transform them into IE8 safe variants.
*/
@bilalq
bilalq / example.php
Created May 26, 2013 05:35
PHP 5.4 advantages
<?php
// Array Literal support
$my_array = [
'you can use',
'[]',
'now'
];
// This used to be a parse error in PHP 5.3.
@bilalq
bilalq / create_users_table.php
Created May 2, 2013 04:40
Sample migration for L3.
<?php
class Create_Users_Table {
/**
* Make changes to the database.
*
* @return void
*/
public function up() {
@bilalq
bilalq / git-remote-hg
Created February 21, 2013 01:33
Felipec's git-remote-hg file with that emulates git's push behaviour. I modified it a little to not complain as often.
#!/usr/bin/env python
#
# Copyright (c) 2012 Felipe Contreras
#
# Inspired by Rocco Rutte's hg-fast-export
# Just copy to your ~/bin, or anywhere in your $PATH.
# Then you can clone with:
# git clone hg::/path/to/mercurial/repo/
<Alloy>
<Window title="Comments" id="gameComments">
<LeftNavButton>
<Button id="leftButton" title="Back" onClick="popWindow" />
</LeftNavButton>
<TableView id="commentsTable" />
<View id="writeComment">
<TextField id="commentText"/>
<Button id="sendBtn" />
</View>
@bilalq
bilalq / TreeNode.java
Created December 7, 2012 21:59
The node for the BST
public class TreeNode
{
private Comparable value;
TreeNode left, right;
public TreeNode(Comparable initValue)
{
value = initValue;
left = null;
right = null;
@bilalq
bilalq / BinarySearchTree.java
Created December 7, 2012 21:32
Someone's BST homework
import java.util.Scanner;
public class BinarySearchTree extends BinaryTree
{
public void insert(Comparable item)
{
if (getRoot() == null)
setRoot(new TreeNode(item));
else
{
@bilalq
bilalq / .htaccess
Created November 10, 2012 23:52
htaccess
RewriteEngine on
RewriteCond $1 !^(index\.php|public|stylesheets|images|javascripts|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
@bilalq
bilalq / vim.txt
Created September 27, 2012 04:09
Vim version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 24 2012 01:10:22)
MacOS X (unix) version
Included patches: 1-646
Compiled by bilalq@Bilals-MacBook-Pro.local
Huge version with MacVim GUI. Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv -cscope +cursorbind +cursorshape +dialog_con_gui +diff
+digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
+file_in_path +find_in_path +float +folding -footer +fork() +fullscreen