Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
<html> | |
<head> | |
<script src='http://code.jquery.com/jquery-1.5.1.min.js'></script> | |
</head> | |
<body> | |
<h2>Naive canvas</h2> | |
<canvas id="naive" width="400" height="50"></canvas> | |
<h2>High-def Canvas</h2> |
class Hash | |
alias :/ :[] | |
end | |
h = {:a => {:b => 'foo'}} | |
h/:a/:b #=> 'foo' |
<!-- using the truncate filter --> | |
{% for post in site.posts limit:10 %} | |
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2> | |
<span class="post-date">{{ post.date | date: "%B %d, %Y" }}</span> | |
{% if post.content.size > 2000 %} | |
{{ post.content | truncatewords: 300 }} <!-- bad! content gives you rendered html and you will truncate in the middle of a node --> | |
<a href="{{ post.url }}">read more</a> | |
{% else %} | |
{{ post.content }} | |
{% endif %} |
// ==UserScript== | |
// @name anti key-grabber | |
// @description Prevent web apps from capturing and muting vital keyboard shortcuts | |
// @grant none | |
// @version 1.1 | |
// ==/UserScript== | |
(function(){ | |
var isMac = unsafeWindow.navigator.oscpu.toLowerCase().contains("mac os x"); | |
unsafeWindow.document.addEventListener('keydown', function(e) { | |
if (e.keyCode === 116) { |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Fix to iOS iframe height issue | |
<iframe id="stupid-iframe" height="200" src="a-file.html"></iframe> | |
<html> | |
<body> | |
<div class="iframe-wrapper" style="width: 100%; height: 200px; overflow: auto; -webkit-overflow-scrolling: touch;"> | |
</div> | |
</body> |
def symbolize_keys(x) | |
if x.is_a? Hash | |
x.inject({}) do |result, (key, value)| | |
new_key = case key | |
when String then key.to_sym | |
else key | |
end | |
new_value = case value | |
when Hash then symbolize_keys(value) | |
when Array then symbolize_keys(value) |
using UnityEngine; | |
/* | |
* Most functions taken from Tween.js - Licensed under the MIT license | |
* at https://github.com/sole/tween.js | |
* Quadratic.Bezier by @fonserbc - Licensed under WTFPL license | |
*/ | |
public delegate float EasingFunction(float k); | |
public class Easing |
using UnityEngine; | |
using System.Collections; | |
using Holoville.HOTween; | |
namespace FS.Handlers | |
{ | |
public class FSScrollController : MonoBehaviour { | |
public float contentOverflowY = 0f; | |
public float contentHeight = 0f; |
@font-face { | |
font-family: 'Roboto'; | |
font-style: normal; | |
font-weight: 400; | |
src: local('Roboto Regular'),local('Roboto-Regular'),url(//fonts.gstatic.com/s/roboto/v15/ek4gzZ-GeXAPcSbHtCeQI_esZW2xOQ-xsNqO47m55DA.woff2)format('woff2'); | |
unicode-range: U+0460-052F,U+20B4,U+2DE0-2DFF,U+A640-A69F; | |
} | |
@font-face { | |
font-family:'Roboto';font-style:normal;font-weight:400;src:local('Roboto Regular'),local('Roboto-Regular'),url(//fonts.gstatic.com/s/roboto/v15/mErvLBYg_cXG3rLvUsKT_fesZW2xOQ-xsNqO47m55DA.woff2)format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; |