Skip to content

Instantly share code, notes, and snippets.

View rankun203's full-sized avatar
🔨
building things

Kun R rankun203

🔨
building things
View GitHub Profile
@rankun203
rankun203 / visor-archivos-online.md
Created September 7, 2016 16:48 — forked from izazueta/visor-archivos-online.md
Google Docs Viewer & Office Web Apps Viewer

Google Docs Viewer

Only files under 25 MB can be previewed with the Google Drive viewer.

Google Drive viewer helps you preview over 16 different file types, listed below:

  • Image files (.JPEG, .PNG, .GIF, .TIFF, .BMP)
  • Video files (WebM, .MPEG4, .3GPP, .MOV, .AVI, .MPEGPS, .WMV, .FLV)
  • Text files (.TXT)
  • Markup/Code (.CSS, .HTML, .PHP, .C, .CPP, .H, .HPP, .JS)
  • Microsoft Word (.DOC and .DOCX)
@rankun203
rankun203 / message-bubble-width.js
Created August 31, 2016 16:50
Calc message bubble width with a log2 function
var x = 30;
var width = 1 - 1 / Math.log2(x + 1);
console.log(width);
@rankun203
rankun203 / commands.sh
Last active August 31, 2016 03:02
Echo everything back to the request sender.
# Install Node.js.
curl -L http://git.io/n-install | bash
# Restart the shell or execute shell profile.
# Install dependency.
npm install koa co-body
@rankun203
rankun203 / noexit
Last active August 5, 2016 07:42
Forever run a command, e.g.: `noexit "echo Hello world." 2`
#!/bin/bash
# usage: watch.sh <your_command> <sleep_duration>
while :;
do
clear
date
$1
sleep $2
done
@rankun203
rankun203 / img-circle.css
Created June 2, 2016 02:35
Make an img be a circle.
border-radius: 50% !important;
/* height: 128px; */
border: 5px solid #fff;
box-shadow: 0 2px 3px rgba(0,0,0,0.25);
@rankun203
rankun203 / nginx-disable-insecure-upgrade.conf
Last active January 8, 2017 13:27
Script to help you start a nginx at current folder
server {
listen 443 ssl;
ssl_certificate /etc/nginx/certs/certs.crt;
ssl_certificate_key /etc/nginx/certs/certs.key;
# Workaround to Upgrade-Insecure-Requests:1 issue...
if ($scheme = https) {
return 301 http://$host$request_uri;
}
@rankun203
rankun203 / verifyEmail.html
Last active September 30, 2016 07:09
A HTML page does the email address verification!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
<style>
.center {
text-align: center;
margin: 0 auto;
Bing Spatial Data Services, 2.0
Id| GeocodeRequest/Culture| GeocodeRequest/Query| GeocodeRequest/Address/AddressLine| GeocodeRequest/Address/AdminDistrict| GeocodeRequest/Address/CountryRegion| GeocodeRequest/Address/AdminDistrict2| GeocodeRequest/Address/FormattedAddress| GeocodeRequest/Address/Locality| GeocodeRequest/Address/PostalCode| GeocodeRequest/Address/PostalTown| GeocodeRequest/ConfidenceFilter/MinimumConfidence|ReverseGeocodeRequest/IncludeEntityTypes| ReverseGeocodeRequest/Location/Latitude| ReverseGeocodeRequest/Location/Longitude| GeocodeResponse/Address/AddressLine| GeocodeResponse/Address/AdminDistrict| GeocodeResponse/Address/CountryRegion| GeocodeResponse/Address/AdminDistrict2| GeocodeResponse/Address/FormattedAddress| GeocodeResponse/Address/Locality| GeocodeResponse/Address/PostalCode| GeocodeResponse/Address/PostalTown| GeocodeResponse/Address/Neighborhood| GeocodeResponse/Address/Landmark| GeocodeResponse/Confidence| GeocodeResponse/Name| GeocodeResponse/EntityType| GeocodeResponse/Mat
@rankun203
rankun203 / a-server-side-geocoding.js
Last active April 30, 2016 03:10
Convert address to geocode
// HTTP request
const http = require('https');
const api = 'https://maps.googleapis.com/maps/api/geocode/json?address=%s',
address = '5101 ASHLEY PHOSPHATE RD STE 145 N CHARLESTON SC 29418-2843',
url = api.replace('%s', address);
http.get(url, res => {
res.on('data', d => {
console.log('' + d);
@rankun203
rankun203 / curl-github-tj-n.sh
Last active April 30, 2016 02:13
A simple way to install latest version of Node.js
curl -L http://git.io/n-install | bash
# then CREATE a NEW terminal session. run node