Skip to content

Instantly share code, notes, and snippets.

View jawdatls's full-sized avatar
💭
I may be slow to respond.

Jawdat Sobh jawdatls

💭
I may be slow to respond.
View GitHub Profile
@jawdatls
jawdatls / instagram-exporter.js
Last active September 30, 2020 11:50
Instagram Exporter - run the script into console tab of inspector of browser then use the methods of instagram object in console after scroll down some posts.
/**
* Instagram Media Exporter
*
* @author: Jawdat Sobh
*/
(function(){
let _list = {}
window.addEventListener('scroll',function(event){
setTimeout(() => {
document.querySelectorAll('.FFVAD').forEach((e) => {
@jawdatls
jawdatls / shape-grid-calculation.js
Created May 10, 2018 09:24
Shape Grid Calculation
// Base
let w = width; // shape width
let h = height; // shape height
let r = row; // grid row start by 0
let c = column; // grid column start by 0
// Square
let left = r * w; // transform left position
let top = j * h; // transform top position
if( null == username_exists( $email_address ) ) {
// Generate the password and create the user
$password = wp_generate_password( 12, false );
$user_id = wp_create_user( $email_address, $password, $email_address );
// Set the nickname
wp_update_user(
array(
/*Filter styles*/
.saturate {-webkit-filter: saturate(3); filter: saturate(3);}
.grayscale {-webkit-filter: grayscale(100%); filter: grayscale(100%);}
.contrast {-webkit-filter: contrast(160%); filter: contrast(160%);}
.brightness {-webkit-filter: brightness(0.25); filter: brightness(0.25);}
.blur {-webkit-filter: blur(3px); filter: blur(3px);}
.invert {-webkit-filter: invert(100%); filter: invert(100%);}
.sepia {-webkit-filter: sepia(100%); filter: sepia(100%);}
.huerotate {-webkit-filter: hue-rotate(180deg); filter: hue-rotate(180deg);}
.rss.opacity {-webkit-filter: opacity(50%); filter: opacity(50%);}
@jawdatls
jawdatls / example.js
Last active November 5, 2015 07:45
jQuery hide function with trigger hide event
$('#priceContainer').on('hide',function(){
$('#price').val("0.0");
});
$('#priceContainer').hideWithEvent();
@jawdatls
jawdatls / date_update.sql
Created November 2, 2015 07:02
mysql query to update only month in date
UPDATE `tbl`
SET `date` = DATE_ADD(`date`, INTERVAL -1 MONTH)
WHERE MONTH(`date`) = 11
<script>
/* configuration */
var count = <?php echo Yii::app()->session->getTimeout(); ?>; //session
var countdown = 60; //warning 60 seconds
var idle = 10; //warning when idle 10 seconds
var urluser = <?php echo "'".Yii::app()->createUrl('site/lock', array('id'=>Yii::app()->user->id))."'"; ?>;
var idlecountdown = countdown;
var idletime = idle;
var show = true;
@jawdatls
jawdatls / nicetime.php
Created May 28, 2015 09:22
Display date time by nice format
function nicetime($date){
if(empty($date)) {
return "No date provided";
}
$periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade");
$lengths = array("60","60","24","7","4.35","12","10");
$now = time();
$unix_date = strtotime($date);
@jawdatls
jawdatls / str_pad.js
Last active December 7, 2017 01:19
Javascript strPad function
function str_pad(input, pad_length, pad_string, pad_type){
var output = input.toString();
if (pad_string === undefined) { pad_string = ' '; }
if (pad_type === undefined) { pad_type = 'STR_PAD_RIGHT'; }
if (pad_type == 'STR_PAD_RIGHT') {
while (output.length < pad_length) {
output = output + pad_string;
}
} else if (pad_type == 'STR_PAD_LEFT') {
while (output.length < pad_length) {
@jawdatls
jawdatls / container-flex.css
Created May 19, 2015 06:56
Flex Container
.container-flex {-webkit-display: -webkit-box;-webkit-display: -webkit-flex;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-align-items: stretch;-webkit-box-align: stretch;-ms-flex-align: stretch;align-items: stretch;}