Skip to content

Instantly share code, notes, and snippets.

View emohamed's full-sized avatar

Emil Mohamed emohamed

View GitHub Profile
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Rock - Scissors - Paper</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js"></script>
<script>
"use strict"
$(function() {
// $('button').click(function() {
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Javascript test file</title>
<script>
var test_var = 5;
console.log(test_var);
</script>
</head>
<?php
Carbon_Container::factory('custom_fields', 'Offices')
->show_on_post_type('page')
->add_fields(array(
Carbon_Field::factory('text', 'sub_title'),
Carbon_Field::factory('complex', 'office_locations')
->add_fields('office', array(
Carbon_Field::factory('text', 'address'),
Carbon_Field::factory('date', 'added_on'),
Carbon_Field::factory('rich_text', 'description'),
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>datepicker demo</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
</head>
<body>
<?php
if ($_SERVER['REQUEST_METHOD']=='POST') {
21try {
$enable_gzip = isset($_POST['gzip']);
$migrator = new WpMigrator($_POST['new-home'], $_POST['new-prefix']);
if (is_uploaded_file($_FILES['dump']['tmp_name'])) {
$file_ext = preg_replace('~.*\.~', '', $_FILES['dump']['name']);
$file_ext = strtolower($file_ext);
@emohamed
emohamed / 0_reuse_code.js
Created November 18, 2015 13:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
Carbon_Field::register_namespace('location', function ($type, $name, $label) {
return Carbon_Field::factory($type, $name, $label)
->set_conditional_logic(array(
'relation' => 'AND',
array(
'field' => 'crb_user_location_type',
'value' => 'fixed',
'compare' => '=',
[
{
"name": "Home",
"link": "home.html"
},
{
"name": "Services",
"link": "interior.html",
"children": [
{
if($('#tweets').length) {
$('#tweets').tweet({
username: 'yourusername', // <<-- Change this to your username
count: 3,
loading_text: 'Loading latest tweets',
template: '{text}{time}'
}).bind('loaded', function() {
$('.tweet_list').addClass('slides');
$('#tweets').flexslider({
slideshowSpeed: 10000,
<!doctype html>
<html>
<head>
<title>PlaceHolders demo</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$.do_placeholders();
});