Skip to content

Instantly share code, notes, and snippets.

View putheakhem's full-sized avatar
🏠
Working from home

Khem Puthea putheakhem

🏠
Working from home
View GitHub Profile
@putheakhem
putheakhem / Decimalconverter.c
Created February 9, 2017 16:02
This Program allow user to convert an integer in decimal value into base 2, 8, 16
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
long decimalToBinary( long integerInDecimal);
long decimalToOctal( long integerInDecimal);
void decimalToHexadecimal( long integerInDecimal);
int main() {
long integerInDecimal;
char option = 'y';
@putheakhem
putheakhem / How to install PHP 7.1 on Mac OS 10.12.4
Created March 31, 2017 12:14
In the gist i will guide you how to install PHP 7.1 over build in PHP 5.6 in Mac Os
Here is a quickly way to install PHP 7.1 on Mac
Make sure you have installed brew
`brew update`
`brew install homebrew/php/php71`
`export PATH="$(brew --prefix( homebrew/php/php71)/bin:$PATH" `
Alternatively you can add `export PATH="$(brew --prefix( homebrew/php/php71)/bin:$PATH" ` in to .bashrc or .zshrc to permenatly change the path to PHP installation
@putheakhem
putheakhem / html5 introduction
Last active October 22, 2017 09:31
A Simple HTML Document
<!--
Author: Khem Puthea
-->
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
@putheakhem
putheakhem / PrimeNumber.c
Created November 13, 2017 15:19
A prime number is a positive integer which is divisible only by 1 and itself. For example: 2, 3, 5, 7, 11, 13
#include <stdio.h>
int main()
{
int n, i, flag = 0;
printf("Enter a positive integer: ");
scanf("%d",&n);
for(i=2; i<=n/2; ++i)
{
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
export default class Example extends Component {
render() {
return (
<div className="container">
<div className="row">
<div className="col-md-8 col-md-offset-2">
<div className="panel panel-default">
@if($errors->has())
@foreach ($errors->all() as $error)
<div>{{ $error }}</div>
@endforeach
@endif
@putheakhem
putheakhem / JavaScriptDOM-1.html
Last active November 21, 2017 08:27
Here is a sample html file with a submit button. Now modify the style of the paragraph text through javascript code
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS DOM paragraph style</title>
</head>
<body>
<p id ='text'>JavaScript Exercises - by Mr Khem Puthea</p>
<div>
<button id="jsStyle"
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS DOM paragraph style</title>
</head>
<body>
<p id ='text'>JavaScript Exercises - by Mr Khem Puthea</p>
<div>
// use onclick action
@putheakhem
putheakhem / setAttribute.html
Created November 21, 2017 15:39
HTML DOM setAttribute() Method
<!DOCTYPE html>
<html>
<head>
<style>
.democlass {
color: red;
}
</style>
</head>
<body>
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels