Skip to content

Instantly share code, notes, and snippets.

View okyanusoz's full-sized avatar
🤠
Always learning

okyanusoz

🤠
Always learning
View GitHub Profile
@tomhodgins
tomhodgins / 500bytes.md
Last active September 6, 2022 21:33
Apps in under 500 bytes, HTML, CSS and JavaScript. Any of these can be copy and pasted into the address bar to be loaded directly, preceded by `data:text/html;charset=utf-8,` or `data:text/html,`

Apps in 500 Bytes or Less

QuickPen 410 bytes

<body oninput="document.querySelector('iframe').srcdoc=h.value+'<style>'+c.value+'</style><script>'+j.value+'<\/script>'"><style>body{margin:0}iframe,textarea{width:100%;height:50vh;float:left}textarea{font-family:monospace;font-size:11pt;line-height:1.4;width:33.33%}</style><textarea id=h placeholder=HTML></textarea><textarea id=c placeholder=CSS></textarea><textarea id=j placeholder=JS></textarea><iframe>

QuickList 440 bytes

<body><style>body{margin:.5em 1em}input{-webkit-appearance:none;appearance:none;width:calc(100% - 4em);float:left;font-size:14pt;padding:.5em;margin:.5em 0}[type=button]{width:3em;margin-left:1em}</style><div id=l></div><input id=i placeholder=reminder autofocus><input type=button value=+ onclick="l.innerHTML+='<input value=\''+i.value+'\'><input type=button value=× onclick=previousSibling.remove();this.remove()>';i.value='';i.focus()">
@eliquious
eliquious / README.md
Created January 4, 2016 05:01
Golang OpenPGP examples

Building

go build -o goencrypt main.go

Generating Keys

@paulirish
paulirish / what-forces-layout.md
Last active May 31, 2024 22:37
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
|=-----------------------------------------------------------------------=|
|=----------------------------=[ BootChess ]=----------------------------=|
|=-----------------------------------------------------------------------=|
|=------------------------=[ by Baudsurfer/rsi ]=------------------------=|
|=-----------------------------------------------------------------------=|
1 - Introduction
1.1 - Why make tiny programs ?
1.2 - Proving know-how remains valued
@DavidWells
DavidWells / reset.css
Last active May 30, 2024 20:06 — forked from karbassi/reset.css
CSS reset. Follow me on the twitters for more tips: https://twitter.com/davidwells
/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@hamstu
hamstu / parallax.js
Last active February 7, 2024 15:20
Parallax Example: JavaScript
var ParallaxManager, ParallaxPart;
ParallaxPart = (function() {
function ParallaxPart(el) {
this.el = el;
this.speed = parseFloat(this.el.getAttribute('data-parallax-speed'));
this.maxScroll = parseInt(this.el.getAttribute('data-max-scroll'));
}
ParallaxPart.prototype.update = function(scrollY) {
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],

Keybase proof

I hereby claim:

  • I am mojombo on github.
  • I am mojombo (https://keybase.io/mojombo) on keybase.
  • I have a public key whose fingerprint is 2D99 08C1 7B77 D96C 626E 0957 AA61 B463 79AA F7E5

To claim this, I am signing this object:

@dhh
dhh / Basecamp-DDOS.md
Last active August 30, 2023 09:33
Basecamp is under network attack (DDoS)

Basecamp was under network attack

The attack detailed below has stopped (for the time being) and almost all network access for almost all customers have been restored. We're keeping this post and the timeline intact for posterity. Unless the attack resumes, we'll post a complete postmortem within 48 hours (so before Wednesday, March 26 at 11:00am central time).

Criminals have laid siege to our networks using what's called a distributed denial-of-service attack (DDoS) starting at 8:46 central time, March 24 2014. The goal is to make Basecamp, and the rest of our services, unavailable by flooding the network with bogus requests, so nothing legitimate can come through. This attack was launched together with a blackmail attempt that sought to have us pay to avoid this assault.

Note that this attack targets the network link between our servers and the internet. All the data is safe and sound, but nobody is able to get to it as long as the attack is being successfully executed. This is like a bunch of people

@carlosefonseca
carlosefonseca / sqlite2csv.sh
Created January 9, 2014 13:44
Exports all tables in a sqlite database to CSV.
#!/usr/bin/env bash
# obtains all data tables from database
TS=`sqlite3 $1 "SELECT tbl_name FROM sqlite_master WHERE type='table' and tbl_name not like 'sqlite_%';"`
# exports each table to csv
for T in $TS; do
sqlite3 $1 <<!
.headers on