Skip to content

Instantly share code, notes, and snippets.

View musaid's full-sized avatar
🏠
Working from home

musaid musaid

🏠
Working from home
View GitHub Profile
<?php
class Encryption {
var $skey = "yourSecretKey"; // change this
public function safe_b64encode($string) {
$data = base64_encode($string);
$data = str_replace(array('+','/','='),array('-','_',''),$data);
return $data;
}
@musaid
musaid / delete.js
Last active August 29, 2015 14:04 — forked from irazasyed/laravel.js
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
(function() {
<?php
/* * **
*
* This script converts an existing MySQL database to migrations in Laravel 4.
*
* 1. Place this file inside app/controllers/
*
* 2. In this file, edit the index() method to customize this script to your needs.
* - inside $migrate->ignore(), you pass in an array of table
<?php
/* * **
*
* This script converts an existing MySQL database to migrations in Laravel 4.
*
* 1. Place this file inside app/controllers/
*
* 2. In this file, edit the index() method to customize this script to your needs.
* - inside $migrate->ignore(), you pass in an array of table
Before compiling, install nginx-naxsi package. This package is compiled with the option --without-http_uwsgi_module.
Uninstall it but without purge for keeping configuration files.
Check https://developers.google.com/speed/pagespeed/module/build_ngx_pagespeed_from_source
---------- OLD ----------
543 wget https://dl.google.com/dl/page-speed/psol/1.6.29.5.tar.gz
->> https://github.com/pagespeed/ngx_pagespeed <<--
549 wget http://labs.frickle.com/files/ngx_cache_purge-2.1.tar.gz
553 wget http://nginx.org/download/nginx-1.5.8.tar.gz
#!/usr/bin/env python
# coding=UTF-8
import argparse
import math
import subprocess
import sys
def main(argv):
parser = argparse.ArgumentParser(description='Display current battery capacity')
@musaid
musaid / .vimrc
Last active August 29, 2015 13:57 — forked from JeffreyWay/.vimrc
" execute pathogen plugins
execute pathogen#infect()
syntax on
filetype plugin indent on
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
var DEBUG_MODE = true; // Set this value to false for production
if(typeof(console) === 'undefined') {
console = {}
}
if(!DEBUG_MODE || typeof(console.log) === 'undefined') {
// FYI: Firebug might get cranky...
console.log = console.error = console.info = console.debug = console.warn = console.trace = console.dir = console.dirxml = console.group = console.groupEnd = console.time = console.timeEnd = console.assert = console.profile = function() {};
}

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
_.extend Backbone.Validation.callbacks,
valid: (view, attr, selector) ->
control = view.$('[' + selector + '=' + attr + ']')
group = control.parents(".control-group")
group.removeClass("error")
if control.data("error-style") == "tooltip"
# CAUTION: calling tooltip("hide") on an uninitialized tooltip
# causes bootstraps tooltips to crash somehow...
control.tooltip "hide" if control.data("tooltip")