Skip to content

Instantly share code, notes, and snippets.

View jobayerarman's full-sized avatar
🤡
Procrastinating

Jobayer Arman jobayerarman

🤡
Procrastinating
View GitHub Profile
@danielpataki
danielpataki / chirp-basic.php
Last active October 7, 2018 17:47
Advanced WP: The Basics Of Object Oriented Programming
// Cut text down to required length
function get_chirp_text( $text ) {
return substr( $text, 0, 200 );
}
// Parse hashtags from text
function get_hashtags( $text ) {
preg_match_all("/S*#((?:\[[^\]]+\]|\S+))/", $text, $matches);
return $matches;
}
@timothyis
timothyis / gulpfile.babel.js
Last active August 21, 2024 00:29
Gulp 4, ES6 gulpfile example
// Gulp module imports
import {src, dest, watch, parallel, series} from 'gulp';
import del from 'del';
import livereload from 'gulp-livereload';
import sass from 'gulp-sass';
import minifycss from 'gulp-minify-css';
import jade from 'gulp-jade';
import gulpif from 'gulp-if';
import babel from 'gulp-babel';
import yargs from 'yargs';
@vielhuber
vielhuber / index.php
Last active September 22, 2017 23:11
parallax effect #js
<div class="parallax" data-ratio="<?php $s = getimagesize("parallax.jpg"); echo round($s[0]/$s[1],2); ?>" data-speed="0.5" >
<span>test</span>
<img class="i" src="parallax.jpg" alt="" />
</div>
@nkbt
nkbt / .eslintrc.js
Last active July 21, 2025 17:55
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@hamstu
hamstu / parallax.js
Last active February 7, 2024 15:20
Parallax Example: JavaScript
var ParallaxManager, ParallaxPart;
ParallaxPart = (function() {
function ParallaxPart(el) {
this.el = el;
this.speed = parseFloat(this.el.getAttribute('data-parallax-speed'));
this.maxScroll = parseInt(this.el.getAttribute('data-max-scroll'));
}
ParallaxPart.prototype.update = function(scrollY) {
@pommiegranit
pommiegranit / mywidget-basic.php
Last active August 30, 2018 12:54
Playing with WordPress widgets
<?php
/*
Plugin Name: My Widget
Plugin URI: http://mydomain.com
Description: My first widget
Author: Me
Version: 1.0
Author URI: http://mydomain.com
*/
@alexJunger
alexJunger / jquery.parallax.js
Created September 16, 2014 22:44
jquery.parallax
/*************************
*---JQUERY PARALLAX---- *
*************************
*
* Alexander Junger, 2014
* License: MIT
*
*/
(function($) {
@fatik
fatik / parallax-header.css
Created September 16, 2014 03:24
Parallax Header
body {
margin: 0;
padding: 0;
font-family: Helvetica, Arial, sans-serif;
}
#hero {
position: relative;
height: 750px;
overflow: hidden;