Skip to content

Instantly share code, notes, and snippets.

View ivolivares's full-sized avatar
🤙
Probably coding!

Iván Olivares R. ivolivares

🤙
Probably coding!
View GitHub Profile
/**
* Object descriptor
**/
var a = {
prop1 : 14
}
var descriptorObj1 = Object.getOwnPropertyDescriptor(a, 'prop1');
/**
* The sample usage of ECMA 5 Mozilla Features Implemented in V8
* https://github.com/joyent/node/wiki/ECMA-5-Mozilla-Features-Implemented-in-V8
* You can use thease new feature of ECMA5 on Node.js as you like.
* because there is no IE :)
* Order is deferent form original wiki.
* Sources are Checked on Node.js v0.5.0(unstable), v0.4.9(stable)
*
* you can execute this file.
* $ node ecma5_on_v8.js
<!DOCTYPE html>
<html>
<link href="style.css" rel="stylesheet" />
<body>
<button id="open">click!</button>
<div id="popup" class="closed"><button id="close">click!</button></div>
</body>
<script src="popup.js"></script>
<script>
var p = document.getElementById('popup');
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
module.exports = function(grunt) {
// Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
src: [
'source/js/libs/*.js', // All JS in the libs folder
@ivolivares
ivolivares / longurl.css
Created July 1, 2014 19:04
Long URL Problem and Solution
/* Problem: <a href="">//someurl.com/a-really-really-really-really-really-really-really-really-really-long-url</a> */
a {
word-wrap: break-word;
}
@ivolivares
ivolivares / scroll-iframe.css
Created July 2, 2014 14:55
Scroll iframes -webkit- ready !
.iframe-holder {
-webkit-overflow-scrolling: touch;
overflow-y: scroll;
}
.iframe-holder iframe {
height: 100%;
width: 100%;
}
<!doctype html>
<html>
<head>
<!-- Run in full-screen mode. -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Make the status bar black with white text. -->
<meta name="apple-mobile-web-app-status-bar-style" content="black">
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e