Skip to content

Instantly share code, notes, and snippets.

View mhamzas's full-sized avatar

Hamza Siddiqui mhamzas

View GitHub Profile
@mhamzas
mhamzas / remove-words.php
Created September 29, 2016 14:31 — forked from keithmorris/remove-words.php
PHP remove common words from a string
<?php
function removeCommonWords($input){
// EEEEEEK Stop words
$commonWords = array('a','able','about','above','abroad','according','accordingly','across','actually','adj','after','afterwards','again','against','ago','ahead','ain\'t','all','allow','allows','almost','alone','along','alongside','already','also','although','always','am','amid','amidst','among','amongst','an','and','another','any','anybody','anyhow','anyone','anything','anyway','anyways','anywhere','apart','appear','appreciate','appropriate','are','aren\'t','around','as','a\'s','aside','ask','asking','associated','at','available','away','awfully','b','back','backward','backwards','be','became','because','become','becomes','becoming','been','before','beforehand','begin','behind','being','believe','below','beside','besides','best','better','between','beyond','both','brief','but','by','c','came','can','cannot','cant','can\'t','caption','cause','causes','certain','certainly','changes','clearly','c\'mon','co','co.','com','come','comes','concerni
@mhamzas
mhamzas / HostNameRouter.php
Last active July 25, 2017 11:06 — forked from chill117/HostNameRouter.php
Manage multiple hostnames (domains, sub-domains) within a single instance of CodeIgniter.
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
Manage multiple hostnames (domains, sub-domains) within a single instance of CodeIgniter.
Example:
If you had the following domain/sub-domain style for your site:
your-domain.com
@mhamzas
mhamzas / solrMysqlSetup.md
Created October 31, 2017 13:15 — forked from rnjailamba/solrMysqlSetup.md
Solr + Mysql + Data Import Handler + Delta Import Handler [ Version 5.5.0 of solr ]
@mhamzas
mhamzas / 00. tutorial.md
Created October 31, 2017 13:48 — forked from maxivak/00. tutorial.md
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
@mhamzas
mhamzas / AutocompleteController.cls
Created December 28, 2017 07:36 — forked from peterknolle/AutocompleteController.cls
Lightning Autocomplete Component
public class AutocompleteController {
@AuraEnabled
public static List<sObject> getSuggestions(String sObjectType, String term, String fieldsToGet, Integer limitSize) {
// could add in logic to remove possible duplicate fields
String fields = fieldsToGet.length() > 0 ? ',' + fieldsToGet : '';
String soql =
' SELECT Name, Id ' + String.escapeSingleQuotes(fields) +
' FROM ' + String.escapeSingleQuotes(sObjectType) +
' WHERE Name Like \'' + String.escapeSingleQuotes(term) + '%\'' +
@mhamzas
mhamzas / apkdl.sh
Created January 31, 2018 14:21 — forked from arulrajnet/apkdl.sh
Script to download apk file from Google Play a.k.a Android Market.
#!/bin/bash
#
# Script to download apk file from Google Play a.k.a Android Market.
# Accepts package name or Google Play URL as input.
# Files are download from apk-dl.com
# author : Arul (@arulrajnet)
#
APK_DL_URL="http://apk-dl.com/store/apps/details?id=%s"
PACKAGE_NAME=""
@mhamzas
mhamzas / media-query.css
Created February 26, 2018 06:25 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@mhamzas
mhamzas / custom-loki.sh
Created April 11, 2018 08:09 — forked from evertontrindade/custom-loki.sh
Things to do after install Elementary OS Loki (0.4)
# First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
# Clean-up System
sudo apt-get purge epiphany-browser epiphany-browser-data #browser
sudo apt-get purge midori-granite #browser
sudo apt-get purge noise
sudo apt-get purge scratch-text-editor #text-editor
sudo apt-get purge modemmanager
sudo apt-get purge geary #email
@mhamzas
mhamzas / Visualforce Remote Objects.js
Last active May 11, 2018 15:06 — forked from dcarroll/gist:8427394
Javascript operations for Visualforce Remote Objects. Totally subject to change as this feature is currently in Developer Preview until Summer '14.
/* PRE - model declaration on vf page
<apex:remoteObjects>
<apex:remoteObjectModel name="Account" fields="Id,Name" />
</apex:remoteObjects>
*/
/* INSTANCE */
// 1. W/o default properties
var acc = new SObjectModel.Account();
@mhamzas
mhamzas / laravel.stpl
Created May 11, 2018 15:05 — forked from inerba/laravel.stpl
Laravel template VESTACP
# /usr/local/vesta/data/templates/web/apache2/laravel.stpl
<VirtualHost %ip%:%web_ssl_port%>
ServerName %domain_idn%
%alias_string%
ServerAdmin %email%
DocumentRoot %sdocroot%/public/
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
Alias /vstats/ %home%/%user%/web/%domain%/stats/