Skip to content

Instantly share code, notes, and snippets.

View vongvisalsambath's full-sized avatar
🎯
Focusing

Vong Visalsambath vongvisalsambath

🎯
Focusing
  • Melos Co., Ltd
  • Phnom Penh, Cambodia
View GitHub Profile
@vongvisalsambath
vongvisalsambath / byte_operations.js
Created December 5, 2018 10:22 — forked from zuk/byte_operations.js
How to convert between integers and bytes in JavaScript
// Here's how to do basic integer<->byte (string/char) operations in JavaScript.
// Took me a good while to dig this up.
function intToChar(integer) {
return String.fromCharCode(integer)
}
function charToInt(char) {
return char.charCodeAt(0)
}
@vongvisalsambath
vongvisalsambath / bin2string.js
Created December 4, 2018 11:33 — forked from taterbase/bin2string.js
Convert bytes to string Javascript
function bin2string(array){
var result = "";
for(var i = 0; i < array.length; ++i){
result+= (String.fromCharCode(array[i]));
}
return result;
}
@vongvisalsambath
vongvisalsambath / example01.js
Created October 22, 2018 15:53 — forked from mpj/example01.js
Code for the async/await episode of Fun Fun Function.
const response = await fetch(`https://catappapi.herokuapp.com/users/${userId}`)
const data = await response.json()
return data.imageUrl
}
@vongvisalsambath
vongvisalsambath / tailwind_md_all_colours.js
Created September 12, 2018 15:19 — forked from davidpiesse/tailwind_md_all_colours.js
A colour set for Tailwind CSS that include all Material Design Colours, shades, accents and contrast colours
// https://davidpiesse.github.io/tailwind-md-colours/
//
//Notes
//
//All colours are generated from Material Design Docs
//Colours have a base, a set of shades (50-900) accent colours
//In addition a companion set of contrast colours are included for colouring text / icons
// Example usage
// class="w-full bg-red-600 text-red-600-constrast"
@vongvisalsambath
vongvisalsambath / nodejs-tcp-example.js
Created August 7, 2018 07:00 — forked from tedmiston/nodejs-tcp-example.js
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@vongvisalsambath
vongvisalsambath / media-queries.scss
Created June 30, 2018 04:38 — forked from chrisl8888/media-queries.scss
All Media Queries breakpoints
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
@vongvisalsambath
vongvisalsambath / meta-tags.md
Created May 29, 2018 17:23 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">