Skip to content

Instantly share code, notes, and snippets.

data:text/html;charset=utf-8, <h1>TextEditor</h1> <link rel="shortcut icon" href="http://g.etfv.co/https://docs.google.com"/> <style> html{height: 100%;} body{background: -webkit-linear-gradient(#f0f0f0, #fff); padding: 3%; height: 94%;} .paper { font-size:2rem; font: normal 16px/1.5 "Lucida Grande", arial, sans-serif; width: 50%; height: 80%; margin: 0 auto; padding: 6px 5px 4px 42px; position: relative; color: #444; line-height: 20px; border: 1px solid #d2d2d2; background: #fff; background: -webkit-gradient(linear, 0 0, 0 100%, from(#d9eaf3), color-stop(4%, #fff)) 0 4px; background: -webkit-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -moz-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -ms-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: -o-linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; background: linear-gradient(top, #d9eaf3 0%, #fff 8%) 0 4px; -webkit-background-size: 100% 20px; -moz-background-size: 100% 20px; -ms-background-size: 100% 20px; -o-background-size
/********************
* TOOLTIP CSS
*/
.nvtooltip {
position: absolute;
background-color: rgba(255,255,255,1);
padding: 10px;
border: 1px solid #ddd;
/**
* @author nicolaspar http://snipplr.com/view.php?codeview&id=1848
*/
function protectXss($val) {
$val = preg_replace('/([\x00-\x08][\x0b-\x0c][\x0e-\x20])/', '', $val);
$search = 'abcdefghijklmnopqrstuvwxyz';
$search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$search .= '1234567890!@#$%^&*()';
$search .= '~`";:?+/={}[]-_|\'\\';
for ($i = 0; $i < strlen($search); $i++) {
@karmiphuc
karmiphuc / tweet parse
Created June 10, 2013 09:14
To auto-magically parse different types of links within a text string. We will look at standard URL links, links applied to Twitter usernames and those applied to Hashtags. @author http://www.simonwhatley.co.uk/parsing-twitter-usernames-hashtags-and-urls-with-javascript @link http://www.simonwhatley.co.uk/examples/twitter/prototype/
/**
* Parsing Twitter Usernames, Hashtags and URLs with JavaScript
*/
//Demo 1. Parsing URLs
String.prototype.parseURL = function() {
return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&~\?\/.=]+/g, function(url) {
return url.link(url);
});
};
@karmiphuc
karmiphuc / getTwProfileInBulk.php
Created September 24, 2013 08:44
Twitter Flow
function getProfileInBulks($bulkID, $attr = 'profile_image_url') {
$opt = $this->options;
$consumer_key = $opt['c_k'];
$consumer_sec = $opt['c_s'];
$oauth_access_token = $opt['o_a_t'];
$oauth_access_sec = $opt['o_a_s'];
$url = 'https://api.twitter.com/1.1/users/lookup.json';
$this->updateUrl($url);
@karmiphuc
karmiphuc / README.md
Created October 14, 2013 01:58 — forked from nikcub/README.md
@karmiphuc
karmiphuc / stripArticle.js
Last active December 30, 2015 14:19
Strip an article post and send to Blogger http://g.karmiphuc.com/Updated sources:1. Blogspot Blogs2. Tinhte.vn3. Hongkiat.com4. Alltop.com
javascript: (function () {
function importJquery(look_for, onload) {
var src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js';
var s = document.createElement('script');
s.setAttribute('type', 'text/javascript');
s.setAttribute('src', src);
if (onload) wait_for_script_load(look_for, onload);
var head = document.getElementsByTagName('head')[0];
if (head) {
head.appendChild(s);
@karmiphuc
karmiphuc / htaccess_caching_tips
Created December 17, 2013 04:17
Htaccess Caching from Wordpress W3 Total Cache. Works in non-Wordpress sites, too.
<IfModule mod_mime.c>
AddType text/css .css
AddType text/x-component .htc
AddType application/x-javascript .js
AddType application/javascript .js2
AddType text/javascript .js3
AddType text/x-js .js4
AddType text/html .html .htm
AddType text/richtext .rtf .rtx
AddType image/svg+xml .svg .svgz
@karmiphuc
karmiphuc / wordpress_webapp_developement_byThachPham
Last active January 1, 2016 04:38
Wordpress and Web App Development - 2013 - Share by Thachpham.com
1. 30 Premium Plugin của CodeCanion: http://www.fshare.vn/folder/TNT4WM9X6T/
2. 30 Days to learn HTML and CSS: http://www.fshare.vn/folder/TA0B6WFKGT/
3. 30 Days to Learn jQuery: http://www.fshare.vn/folder/TSZBYX7Z4T/
4. Cleaner Code With CoffeeScript: http://www.fshare.vn/folder/TNAQ38Q8FT/
5. CodeIgniter Essentials: http://www.fshare.vn/folder/TV5YTDC7BT/
6. CSS Terminology Decoded: http://www.fshare.vn/folder/TJMZQPDHDT/
7. CSS3 Animations: http://www.fshare.vn/folder/TJ51P6038T/
8. Design & Build Coming Soon Page: http://www.fshare.vn/folder/T5TQNQAW3T/
9. Design Creative Portfolio Theme: http://www.fshare.vn/folder/TJHVRB47RT/
10. Effective Landing Page Design in Photoshop: http://www.fshare.vn/folder/T7HDA6MN5T/
@karmiphuc
karmiphuc / url2imgur.php
Created December 23, 2013 08:41
Upload an Image from a URL to Imgur
<?php
/**
* Original script source http://designshack.net/articles/javascript/how-to-build-a-dynamic-imgur-upload-app-using-jquery-php/
*
* http://playground.zaplabs.com/sandbox/qa/stackexchange/stackoverflow/17269448/index.php
* http://playground.zaplabs.com/sandbox/qa/stackexchange/stackoverflow/17269448/index.php.source
*/
function uploadToImgur($image) {
$client_id = "IMGUR_CLIENT_ID";