Skip to content

Instantly share code, notes, and snippets.

View eimg's full-sized avatar

Ei Maung eimg

View GitHub Profile
@eimg
eimg / php-in-html.php
Created May 30, 2012 08:46
Embedded PHP in HTML document.
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>PHP Template</title>
</head>
<body>
<h1>Countries</h1>
<table>
<tr>
@eimg
eimg / php-template.php
Created May 30, 2012 08:49
Template style with PHP short open tags.
<?php
$countries = array(
array('iso'=>'AS', 'name'=>'American Samoa', 'iso3'=>'ASM'),
array('iso'=>'AD', 'name'=>'Andorra', 'iso3'=>'AND'),
array('iso'=>'AO', 'name'=>'Angola', 'iso3'=>'AGO'),
array('iso'=>'AG', 'name'=>'Antigua and Barbuda', 'iso3'=>'ATG'),
array('iso'=>'AR', 'name'=>'Argentina', 'iso3'=>'ARG'),
array('iso'=>'AM', 'name'=>'Armenia', 'iso3'=>'ARM'),
array('iso'=>'AT', 'name'=>'Austria', 'iso3'=>'AUT'),
array('iso'=>'AZ', 'name'=>'Azerbaijan', 'iso3'=>'AZE'),
@eimg
eimg / javascript.html
Created May 30, 2012 08:54
Creating content with Javascript
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Javascript Template</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
$(function() {
var countries = [
@eimg
eimg / javascript-tmpl.html
Created May 30, 2012 09:00
Creating content with Javascript. Using jQuery Template.
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Javascript Template</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>
<script>
@eimg
eimg / bb-todo-todo.html
Created August 29, 2013 04:12
todo.html from eimg/bb-todo
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Backbone Todo</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<section id="app">
@eimg
eimg / bb-todo-app.js
Created August 29, 2013 04:08
app.js from eimg/bb-todo
var app = {};
// Model
app.Todo = Backbone.Model.extend({
defaults: {
title: '',
done: false
},
toggle: function() {
<html ng-app="ngSlides">
<head>
<script src="js/angular.min.js"></script>
<script src="js/ngSlides.js"></script>
</head>
<body>
<div ng-controller="SlideController">
<div class="slide {{slide.state}}"
ng-repeat="slide in slides" id="slide-{{$index}}">
@eimg
eimg / wp-install.sh
Created October 29, 2013 14:15
Download and install latest version of Wordpress. Only for XAMPP linux on Ubuntu.
#!/bin/bash
echo "Project/DB Name: "; read -e dbname
echo "Database User: "; read -e dbuser
echo "Database Password: "; read -s dbpass
echo "Run the install? (y/n)"; read -e run
if [ "$run" == n ] ; then
exit
else
wget http://wordpress.org/latest.tar.gz
@eimg
eimg / generate-image-thumb.php
Last active November 28, 2017 03:59
Create image thumb on given size without effection original aspect ratio
<?php
function generate_thumb($source_image_path, $thumbnail_image_path, $result_width, $result_height) {
if(!file_exists($source_image_path)) {
return false;
}
if(!getimagesize($source_image_path)) {
return false;;
}
@eimg
eimg / atom-global-style.less
Created January 14, 2019 06:19
Atom bracket colorizer custom style for light color scheme
atom-text-editor.editor {
.bracket-colorizer-color0 {
color: brown;
}
.bracket-colorizer-color1 {
color: darkslategray;
}
.bracket-colorizer-color2 {