Skip to content

Instantly share code, notes, and snippets.

View farindra's full-sized avatar

Farindra farindra

View GitHub Profile
// basic implementation, where pivot is the first element
function quickSortBasic(array) {
if(array.length < 2) {
return array;
}
var pivot = array[0];
var lesserArray = [];
var greaterArray = [];
@farindra
farindra / chmod.sh
Created July 25, 2019 00:33
chmod file and folder recrusive
find /yourfolder -type d -exec chmod 755 {} \;
find /yourfolder -type f -exec chmod 644 {} \;
@farindra
farindra / firebird_select_blob.sql
Created May 17, 2019 22:21
Select Blob As Text / Varchar Firebird
SELECT CAST(SUBSTRING(r.APPDESC FROM 1 FOR 32000) AS VARCHAR(32000)) AS NewBlobColumn
FROM ITEM r where r.ITEMNO='778312000993'
@farindra
farindra / Workers.sql
Created May 12, 2019 09:56
BE_SQL #2
-- Write only the SQL statement that solves the problem and nothing else.
SELECT name FROM employees WHERE id NOT IN (
SELECT managerId FROM employees WHERE managerId IS NOT NULL
) ;
-- Write only the SQL statement that solves the problem and nothing else.
SELECT count(*) as number FROM students WHERE `firstname` = 'John';
<?php
class Pipeline
{
public static function make_pipeline(...$funcs)
{
return function($arg) use ($funcs)
{
foreach($funcs as $function){
if(!isset($value))
$value = $function($arg);
<?php
class Palindrome
{
public static function isPalindrome($word)
{
$word = strtolower(trim($word));
if (strrev($word) == $word)
return TRUE;
else
https://www.routecloud.net/blog/install-kubernetes-cluster-di-centos-7/
@farindra
farindra / .htaccess
Created March 16, 2019 19:21
Codeigniter 3 Subdomain htaccess
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
@farindra
farindra / key.md
Created February 12, 2019 14:13
FREE IntelliJ IDEA key 2018.2!

READ or DIE

  • put 0.0.0.0 account.jetbrains.com into your hosts file (C:\Windows\System32\drivers\etc\hosts or /etc/hosts)
  • for GayOS macOS read that
  • use the key below
K71U8DBPNE-eyJsaWNlbnNlSWQiOiJLNzFVOERCUE5FIiwibGljZW5zZWVOYW1lIjoibGFuIHl1IiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiSUkiLCJwYWlkVXBUbyI6IjIwMTktMDUtMDQifSx7ImNvZGUiOiJSUzAiLCJwYWlkVXBUbyI6IjIwMTktMDUtMDQifSx7ImNvZGUiOiJXUyIsInBhaWRVcFRvIjoiMjAxOS0wNS0wNCJ9LHsiY29kZSI6IlJEIiwicGFpZFVwVG8iOiIyMDE5LTA1LTA0In0seyJjb2RlIjoiUkMiLCJwYWlkVXBUbyI6IjIwMTktMDUtMDQifSx7ImNvZGUiOiJEQyIsInBhaWRVcFRvIjoiMjAxOS0wNS0wNCJ9LHsiY29kZSI6IkRCIiwicGFpZFVwVG8iOiIyMDE5LTA1LTA0In0seyJjb2RlIjoiUk0iLCJwYWlkVXBUbyI6IjIwMTktMDUtMDQifSx7ImNvZGUiOiJETSIsInBhaWRVcFRvIjoiMjAxOS0wNS0wNCJ9LHsiY29kZSI6IkFDIiwicGFpZFVwVG8iOiIy