Skip to content

Instantly share code, notes, and snippets.

View oritromax's full-sized avatar
💭
Working !

Oritro Ahmed oritromax

💭
Working !
View GitHub Profile
@oritromax
oritromax / functions.php
Created January 10, 2014 23:42
A simple shortcode to embed responsive youtube video in wordpress. Explained in the code !
<?php
/* Copy and Paste the Whole Code Below this line */
/* When you are using it inside functions.php, You might wanna loose the start and end PHP tag */
/* The Shortcode Format Will be -> [youtube-vid id="Video ID" res="Video Resolution"] */
/* In http://www.youtube.com/watch?v=a8ZeqZrLxpw <- this video, a8ZeqZrLxpw is the id */
/* This simple Shortcode Cover 4 premade resolution and 1 fallback. 240p, 360p, 480p, 720p and 240p fallback */
/* A Very Simple Effort to make your life easier, By Oritro Ahmed [ http://ioritro.com ] */
/* And FYI: you don't need to copy this long comment section */
@oritromax
oritromax / .htaccess
Created May 18, 2015 17:41
Stripped .htaccess code from html5 boilerplate, only necessary comments were kept
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
<FilesMatch "\.(bmp|cur|gif|ico|jpe?g|png|svgz?|webp)$">
SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
</FilesMatch>
</IfModule>
</IfModule>
<IfModule mod_headers.c>
@oritromax
oritromax / bill.php
Last active October 18, 2015 07:16 — forked from sarim/bill.php
<?php
if(isset($_GET['unit'])) {
$userunit = $_GET['unit'];
$bills = array (
array (
'min' => 1,
'max' => 75,
'price' => 3.8
),
@oritromax
oritromax / address.html
Last active May 23, 2016 17:35
Project For lisa
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Address Page</title>
</head>
<body>
@oritromax
oritromax / trsteel_ckeditor.yml
Created September 15, 2016 15:30
trsteel_ckeditor.yml for Symfony
trsteel_ckeditor:
class: Trsteel\CkeditorBundle\Form\Type\CkeditorType
# transformers: ['html_purifier']
toolbar: ['document', 'clipboard', 'editing', '/', 'basicstyles', 'paragraph', 'links', '/', 'insert', 'styles', 'tools']
toolbar_groups:
document: ['Source','-','Save','-','Templates']
clipboard: ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo']
editing: ['Find','Replace','-','SelectAll']
basicstyles: ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat']
paragraph: ['NumberedList','BulletedList','-','Outdent','Indent','-','JustifyLeft', 'JustifyCenter','JustifyRight','JustifyBlock']
@oritromax
oritromax / googlemapautocomplete.js
Last active December 12, 2019 23:52
After my hurdle with Google Map JS API, Writing this to help any lost soul. This only serves the purpose of filling a Standard address field ! Make sure you have Places API and Map JS API Enabled in your Google Console !
// Make sure to load this after the HTML is loaded. Also, don't forget to include the API with '&libraries=places' for this to work
$(window).on('load',function () {
// The field where people will search their address, Must be a text input
var searchinput = 'street_number';
// Don't need Place Search For this Example
var autocomplete;
// Could've done the following line a bit easier !
autocomplete = new google.maps.places.Autocomplete((document.getElementById(searchinput)),{
types: ['geocode']
$(window).on('load',function () {
var searchinput = 'street_number';
var autocomplete;
autocomplete = new google.maps.places.Autocomplete((document.getElementById(searchinput)),{
types: ['geocode']
});
autocomplete.addListener('place_changed', fillInAddress);
function fillInAddress() {
var place = autocomplete.getPlace();