This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- The original idea came from https://github.com/nathanford/data-href --> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<section> | |
<p data-href="#/paragraph/url/"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
module.exports = function (grunt) { | |
grunt.initConfig({ | |
options: { | |
command: 'touch', | |
args: '', | |
filepath: '', | |
file: '' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.columns(@property: 1) { | |
& > .cell { | |
width: 100% / @property; | |
} | |
} | |
.generate-row(@n, @i: 1) when (@i =< @n) { | |
&.row@{i} { | |
.columns(@i); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.rot17 = function() { | |
return this.replace(/[ა-ჱ]/g, function(c) { | |
c = c.charCodeAt() + 17; | |
return String.fromCharCode(c <= 4337 ? c : c - 34); | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// define app | |
angular.module('app', []) | |
// listen to state changes | |
.config(function($rootScope) { | |
$rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState) { | |
// redirectTo | |
if (toState.redirectTo) { | |
event.preventDefault(); | |
$state.go(toState.redirectTo, toParams); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.service('CurrencyExchange', function($http, $q) { | |
// using public API for currency exchange rates | |
return function (from, rates) { | |
var deferred = $q.defer(); | |
var base = from.toUpperCase(); | |
var currencies = []; | |
if (typeof rates === 'string') { | |
currencies = base + '_' + rates.toUpperCase(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
var marked = require('marked') | |
var app = express(); | |
// use README.md file as a homepage | |
app.get('/', function(req, res) { | |
res.set('content-type','text/html'); | |
res.send( | |
'<style>' + | |
fs.readFileSync('./node_modules/github-markdown-css/github-markdown.css') + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
var cp = require('child_process') | |
var fs = require('fs') | |
var installOthersSetting = true | |
var pull = true | |
const GLOBAL_MODULES = __dirname + '/hacked_node_modules' | |
// prop clean up nodemodules linkers -- else npm is become a problem | |
var mySetup = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs') | |
var LineByLine = require('line-by-line') | |
var bundle = 'bundle.css' | |
var _bundle = '_bundle.css' | |
var file = 'new.less' | |
var _file = '_new.less' | |
var cleanRegEx = /^((\s+)?((\.|\@|\d).+|color|background|border|a|html|body|div|section|div|body|section|img|thumb|\:\:).+|((\s+)?\}))/m | |
var emptyRegEx = /^((.+\,\n)+)?(.+\{)(\n+|\s+)\}\n?/gm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(interval){ | |
const start = Date.now() | |
const end = start + 1000 | |
let i = 0 | |
function hackRandom () { | |
let now = Date.now() | |
if (now > end) { | |
console.log(`timestamp: ${now}`, `random: ${Math.random()}`) | |
i++ | |
} |
OlderNewer