Skip to content

Instantly share code, notes, and snippets.

View athiwatp's full-sized avatar
💭
I may be slow to respond.

athiwatp athiwatp

💭
I may be slow to respond.
View GitHub Profile
jQuery( ".coupon_count" ).each(function( index ) {
console.log( index + ": " + jQuery( this ).text() );
if( jQuery(this).text() == 0 ){
jQuery('class ปุ่ม').add('class สีเทา');
}
});
@athiwatp
athiwatp / facebook.php
Created November 23, 2016 15:05 — forked from jonathantneal/facebook.php
Getting social media feeds as JSON in PHP
<?php
/* Getting a JSON Facebook Feed
==========================================================================
1. Sign in as a developer at https://developers.facebook.com/
2. Click "Create New App" at https://developers.facebook.com/apps
3. Under Apps Settings, find the App ID and App Secret
@athiwatp
athiwatp / GPointGenerator.html
Created December 28, 2016 08:46 — forked from rgabbard/GPointGenerator.html
Point generator for Google Map routes
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Utility to generate points along a route using the Google Maps API
Directions service.
2011-03-31 Rob Gabbard, cintimedia LLC, www.cintimedia.com
Based on the Google Maps API Optimized Directions demo at:
@athiwatp
athiwatp / restAPI.markdown
Created January 9, 2017 04:08 — forked from iksose/restAPI.markdown
Creating a REST API using Node.js, Express, and MongoDB

###Creating a REST API using Node.js, Express, and MongoDB

####Installing Node.js

Go to http://nodejs.org, and click the Install button. Run the installer that you just downloaded. When the installer completes, a message indicates that Node was installed at /usr/local/bin/node and npm was installed at /usr/local/bin/npm. At this point node.js is ready to use. Let’s implement the webserver application from the nodejs.org home page. We will use it as a starting point for our project: a RESTful API to access data (retrieve, create, update, delete) in a wine cellar database.

Create a folder named nodecellar anywhere on your file system. In the wincellar folder, create a file named server.js.

@athiwatp
athiwatp / border.css
Created January 10, 2017 03:37 — forked from nrrrdcore/border.css
Faded/Gradient Borders in Pure CSS
.border-container {
width: 28%; /* border will be on the left on this container */
float: right;
overflow: hidden; /* only needed if floating container */
min-height: 600px; /* static height if you want your container to be taller than its content */
-moz-box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF;
-webkit-box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF;
box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF;
border-width: 0 0 0 1px;
-webkit-border-image:
@athiwatp
athiwatp / how-to-setup-mac-elasticsearch.md
Created January 23, 2017 10:39 — forked from jpalala/how-to-setup-mac-elasticsearch.md
setting up elasticsearch on your mac with brew

Install va homebrew

If you don't have homebrew installed - get homebrew here

Then run: brew install elasticsearch

Configuration

Update the elasticsearch configuration file in /usr/local/etc/elasticsearch/elasticsearch.yml.

@athiwatp
athiwatp / main.css
Created January 30, 2017 18:11
A simple Twitter timeline with AngularJS
/* Some style resets */
h1, h2, h3, h4, h5, h6, form, input, dl, dt, dd, ul, ol, p, fieldset { padding: 0; margin: 0; }
/* HTML5 block-level reset for enhanced structural tag support in older browsers */
header, footer, section, aside, nav, article, figure { display: block; }
body {
color: rgb(17,17,17);
overflow-y: scroll;
font: normal 14px/1.6em "Lato", "Lucida Grande", "Lucida Sans", "Lucida Sans Unicode", "Verdana", sans-serif;
@athiwatp
athiwatp / MongoDB_macOS_Sierra.md
Created February 3, 2017 10:36 — forked from nrollr/MongoDB_macOS_Sierra.md
Install MongoDB on Sierra using Homebrew

##Install MongoDB on macOS Sierra

This procedure explains how to install MongoDB using Homebrew on macOS Sierra 10.12.
Official MongoDB install documentation: here

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@athiwatp
athiwatp / social-feeds.html
Created February 6, 2017 08:12 — forked from bbrochier/social-feeds.html
Social Feeds
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Social Data</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/screen.css">
<script src="js/vendor/modernizr-2.6.2.min.js"></script>
@athiwatp
athiwatp / fb-page-feed.js
Created February 6, 2017 08:32 — forked from julienrf/fb-page-feed.js
A small js snippet retrieving the feed of a Facebook page and displaying its elements.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
<script src="http://connect.facebook.net/fr_FR/all.js"></script>
<script>
// Replace the id by any other public page id
FB.api('170913076256527/feed', { limit: 3 }, function(result) {
$('#fb-feed').empty();
$(result.data).each(function(i, post) {
entry = $('<div class="fb-item"></div>');
if (post.icon) {
entry.append('<img class="icon" src="' + post.icon + '" />');