Skip to content

Instantly share code, notes, and snippets.

@sfrdmn
sfrdmn / cool_dude.js
Last active October 12, 2015 06:37
cool dude
a = document.createElement('div');
b = ['◡ ◡','⊙ ⊙'];
h = window.innerHeight;
w = window.innerHeight;
s = h*.8;
i = 0;
a.style.fontSize = s+'px';
a.style.position = 'fixed';
a.style.left = '0';
a.style.right = '0';
@sfrdmn
sfrdmn / LICENSE.txt
Created November 26, 2012 23:30
MIT License 2012
Copyright (C) 2012 Sean Fridman
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
@sfrdmn
sfrdmn / sfrdmn.vim
Last active December 19, 2015 20:18
vim config for use with vundle
syntax on
set ts=2
set shiftwidth=2
set autoindent
set smartindent
set expandtab
set ruler
highlight ExtraWhitespace ctermbg=red guibg=red
@sfrdmn
sfrdmn / image_downloader.js
Last active March 13, 2025 11:24
Bookmarklet to download all images on a page
;(function() {
var images = [].slice.call(document.querySelectorAll('img'))
try {
images.forEach(function(img) {
downloadImage(img)
})
} catch (e) {
alert("Download failed.");
console.log('Download failed.', e);
}
diff -ru layoutlib_4-0-3-r1/Android.mk layoutlib_4-4-2-r1/Android.mk
--- layoutlib_4-0-3-r1/Android.mk 2014-03-13 18:27:34.000000000 -0700
+++ layoutlib_4-4-2-r1/Android.mk 2014-03-13 18:28:01.000000000 -0700
@@ -25,12 +25,15 @@
# We need to process the framework classes.jar file, but we can't
# depend directly on it (private vars won't be inherited correctly).
# So, we depend on framework's BUILT file.
-built_framework_dep := $(call java-lib-deps,framework)
-built_framework_classes := $(call java-lib-files,framework)
+built_framework_dep := $(call java-lib-deps,framework-base)
@sfrdmn
sfrdmn / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@sfrdmn
sfrdmn / designer.html
Created October 24, 2014 06:35
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@sfrdmn
sfrdmn / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@sfrdmn
sfrdmn / latency.txt
Created August 20, 2016 18:44 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@sfrdmn
sfrdmn / mcr_post_01.jsx
Created December 1, 2017 15:53
mcr_post_01
const addFoodItem = item => ({ type: 'ADD_FOOD_ITEM', payload: item })