Skip to content

Instantly share code, notes, and snippets.

View lshaf's full-sized avatar
💭
Working

L Shaf lshaf

💭
Working
View GitHub Profile
/******************************************************************************
jquery.transformable.js v0.3.4 copyright 2013 Aaron Flin (aaron at flin dot org).
- fixed test for mozillaOverflowHiddenBug, which would improperly always return true
- todo: fix the parseFloat(computedStyle.[top|left]) in jQuery.fn.transformable.offsetNoGetBounds
so that it can handle %, or better yet, figure out a better way. Without a fix, I think
older Mozilla browsers will choke on a div with offsetParents that are not positioned in 'px'
jquery.transformable.js v0.3.3 copyright 2013 Aaron Flin (aaron at flin dot org).
- added initial support for dragging sortables in transformed divs.
@lshaf
lshaf / composer.bat
Created February 5, 2015 08:25
Composer for windows
@php "%~dp0composer.phar" %*
@lshaf
lshaf / project.bat
Last active September 1, 2017 08:45
Auto direct path to project [windows + VSCODE]
@if "%1" == "" goto NOPROJECT
@if "%2" == "" goto NODIR
@if "%1" == "rn" SET FOLDER=rn
@if "%1" == "web" SET FOLDER=web
@SET MAIN_FOLDER=\%FOLDER%-project\%2
@if exist "%~d0\%MAIN_FOLDER%" (
@cd /d "%~dp0"
@lshaf
lshaf / word_splitter.php
Last active February 19, 2016 13:43
Words splitter
<?php
$text = isset($_POST['a']) ? $_POST['a'] : '';
$uname = isset($_POST['uname']) ? $_POST['uname'] : '';
$mode = isset($_POST['mode']) ? $_POST['mode'] : '';
$modeList = [
'kuroshi' => 'Kuroshi',
'shiba' => 'Shiba'
];
?>
<!DOCTYPE html>
@lshaf
lshaf / vhost-apache.conf
Last active March 9, 2020 16:48
vhost configuration
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName belajar-test.dev
DocumentRoot D:\web-project\test.dev\frontend\web
<Directory D:\web-project\test.dev\frontend\web>
Options -Indexes +FollowSymLinks +MultiViews
Require all granted
AllowOverride all
Order allow,deny

Guide

Note The extension Imagick is now included in Ondrej's PPA. All you need to do now is $ sudo apt-get install php-imagick, and you're done. I'll keep the guide here because a lot of it is still true for other extensions

======

I've installed PHP7 via Ondrej's PPA. He maintains these PPA's on his free time, consider donating

Install dependencies

@lshaf
lshaf / overlap_test.php
Created February 19, 2016 13:42
Script to test date range overlap
<?php
echo '<pre>';
$sDate = '2016-02-03';
$eDate = '2016-02-10';
$overlapTest = [
# start before sDate
['2016-02-01', '2016-02-03'],
['2016-02-01', '2016-02-02'],
['2016-02-01', '2016-02-09'],
['2016-02-01', '2016-02-11'],
@lshaf
lshaf / idToChar.js
Created May 8, 2018 06:47
Converting numeric id to character id
function idToChar(id) {
const alpha = "1234567890abcdefghijklmnopqrstuvwxyz-_";
var tempId = id;
var shortCode = "";
while (tempId > 0) {
var mod = tempId % alpha.length;
tempId = Math.floor(tempId / alpha.length);
shortCode = `${alpha.charAt(mod)}${shortCode}`;
}
/**
WHAT IS THIS?
- This is script to do auto click unfollow button on instagram
HOW TO USE IT?
- Open your profile after logged in
- Open following tab
- Scroll following window until the bottom (optional)
- Run code below on DevTool Console
@lshaf
lshaf / dnscrypt.md
Created December 28, 2018 04:21 — forked from pengelana/dnscrypt.md
dnscrypt