Skip to content

Instantly share code, notes, and snippets.

View edwinyzh's full-sized avatar

Edwin Yip edwinyzh

View GitHub Profile
@ssokolow
ssokolow / pagination_example.sql
Created December 23, 2009 13:02
Reasonably efficient pagination without OFFSET (SQLite version)
-- Reasonably efficient pagination without OFFSET
-- SQLite version (Adapted from MS SQL syntax)
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6
SELECT foo, bar, baz, quux FROM table
WHERE oid NOT IN ( SELECT oid FROM table
ORDER BY title ASC LIMIT 50 )
ORDER BY title ASC LIMIT 10

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@frostney
frostney / Baking.js
Created May 4, 2011 03:23
This is a code snippet which shows how to embed JavaScript (using BESEN, http://besen.sourceforge.net) in FreePascal/Delphi applications. I used FPC 2.5.1, compiled using "fpc -Mdelphi FPCScript.dpr" and tested under Ubuntu Linux 10.10 (32-bit).
//importScript("Test.js"); // Imports & executes Test.js
// Wohooo, JavaScript inside of JavaScript. That's meta.
execute("(function() { print('Hello world') })();");
print("--- Let's have a cake ---");
var myCake = new Cake();
myCake.Info();
print("--- I'm hungry ---");
@mbostock
mbostock / .block
Last active March 29, 2023 23:39
Collapsible Indented Tree
license: gpl-3.0
redirect: https://observablehq.com/@d3/indented-tree
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@clayzermk1
clayzermk1 / README.md
Created August 10, 2012 19:54
jQuery / Twitter Bootstrap List Tree Plugin

jQuery / Twitter Bootstrap List Tree Plugin

Demo: http://jsfiddle.net/clayzermk1/QD8Hs/

Overview

I needed a simple plugin to build a two-tier collapsible list with checkboxes. I wanted it to fit well with Twitter's Bootstrap. I couldn't find one that was simple enough. I hope you enjoy =) Feel free to send feedback.

@mbostock
mbostock / .block
Last active June 7, 2024 07:40 — forked from mbostock/.block
Circle Packing
license: gpl-3.0
height: 960
border: no
redirect: https://beta.observablehq.com/@mbostock/d3-circle-packing
@mbostock
mbostock / .block
Last active October 31, 2023 14:57 — forked from mbostock/.block
Radial Tidy Tree
license: gpl-3.0
border: no
height: 1060
redirect: https://beta.observablehq.com/@mbostock/d3-radial-tidy-tree
@mbostock
mbostock / .block
Last active May 4, 2023 14:15
Zoomable Sunburst
license: gpl-3.0
redirect: https://observablehq.com/@d3/d3-zoomable-sunburst
@mbostock
mbostock / .block
Last active June 7, 2024 07:40
Zoomable Circle Packing
license: gpl-3.0
height: 960
redirect: https://observablehq.com/@d3/d3-zoomable-circle-packing