Skip to content

Instantly share code, notes, and snippets.

View byjml's full-sized avatar
🎯
Focusing

@byjml byjml

🎯
Focusing
  • Bixi
  • Somalia
  • 16:47 (UTC +03:00)
  • X @byjml
View GitHub Profile
#!/bin/sh
git clone https://github.com/laravel/laravel.git $1
cd $1
# Required for getting L4 dev
git reset --hard HEAD
git checkout master
git remote rename origin upstream
{
"countries" : [
{
"code": "ZW",
"name": "Zimbabwe"
},
{
"code": "ZM",
"name": "Zambia"
},

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
# Initial setup
git clone -o framework -b develop https://github.com/laravel/laravel.git project-name
cd project-name
git checkout --orphan master
git commit -m "Initial commit"
# Pulling changes
git fetch framework
git merge --squash -m "Upgrade Laravel" framework/develop
# Fix merge conflicts if any and commit
@byjml
byjml / circle.html
Created February 28, 2013 08:14
HTML/CSS circle
<div class="circle circle-100x100"></div>
@byjml
byjml / select-country.html
Last active December 11, 2015 04:48
240 States Dropdown
<select name="countries-dropdown">
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
<option value="Anguilla">Anguilla</option>
<option value="Antarctica">Antarctica</option>
<option value="Antigua and Barbuda">Antigua and Barbuda</option>
@byjml
byjml / validate_wildcard_dns.php
Created October 4, 2012 13:36
Wildcard DNS validation regex.
<?php
/**
* Uses a simple regex to validate a wildcard DNS format.
*
* It validates the following entry formats:
* *.example.com.
* *.exa.m.ple.com.
* *.exa-mp.le.com.
* *.ex--ample.com.
*/
@byjml
byjml / wp_hook_inspector.php
Last active August 9, 2021 21:30
WordPress Hook Inspector: Inspects which functions are attached into what hook.
<?php
/**
* Plugin Name: WordPress Hook Inspector
* Description: Provides a shortcode that displays information table about which function is hooked into what hook. The information displayed is only for debugging and the shortcode will not display anything if the post included is not password protected. <strong>Usage:</strong> add [inspect hook="hook_name"] for single hooks or [inspect] for all hooks. The shortcode requires the post to be password protected.
* Author: JML
* Author URI: http://jml.so
* Version: 1.0
* License: GNU General Public License v2.0
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
@byjml
byjml / responsive-embed-wrapper.php
Last active September 29, 2015 12:17
Respensive embed and iframe for WordPress
<?php
/* Hook responsive_embed_wrapper function to 'the_content' filter. */
add_filter( 'the_content', 'responsive_embed_wrapper', 20 );
/**
* Adds wrapper and container divs to make <object> and <iframe> embeds responsive to
* CSS media queries.
*
*
* @link http://webdesignerwall.com/tutorials/css-elastic-videos
@byjml
byjml / conditional_js.php
Created October 16, 2011 07:25 — forked from peterwilsoncc/functions.php
Conditional commented JavaScript in WordPress
<?php
/* Hook the HTML5 shiv into WP. */
add_action('wp_print_scripts', 'mytheme_ie_specific_js');
/**
* Attaches conditionally commented JS file into wp_print_scripts hook.
*
* A modified version of Peter Wilson's gist https://gist.github.com/1282923
*