Skip to content

Instantly share code, notes, and snippets.

@jedsundwall
jedsundwall / gist:2244379
Created March 29, 2012 22:26
hacking google spreadhseets
function makeURL(firstname,lastname) {
var name = "firstname + lastname";
if (name = null) {
return null
};
else return name;
}
@tantalor
tantalor / gist:2244383
Created March 29, 2012 22:27 — forked from jedsundwall/gist:2244379
hacking google spreadhseets
function makeURL(firstname,lastname) {
var name = firstname + lastname;
if (!name) {
return null;
} else {
return name;
}
}
@tantalor
tantalor / newcomments.pl
Created November 8, 2013 23:49
A perl script which outputs the usernames for new comments on Hacker News, preceded by the date.
#!/usr/bin/perl
my $url = "https://news.ycombinator.com/newcomments";
sub html {
`curl get $url 2>/dev/null`;
}
printf "# %s", `date`;
@bonniss
bonniss / better-sqlite3-cheatsheet.md
Last active May 5, 2024 16:11
better-sqlite3 cheatsheet

Refs:

// Init new db
// If the database file does not exist, it is created
// This happens synchronously, which means you can start executing queries right away
const Database = require('better-sqlite3');
@tantalor
tantalor / moon.html
Created March 12, 2012 22:25
Moon in px
<body style="background: black">
<a href="http://inamidst.com/stuff/notes/csspx">
<img src="http://upload.wikimedia.org/wikipedia/en/thumb/c/c9/Moon_nearside_LRO.jpg/170px-Moon_nearside_LRO.jpg" style="width:24.3px;height:24.3px">
</a>
module MyApp::Controllers
class Test1 < R '/test1'
end
class Test2 < R '/test2'
end
SITE_BASE_URL = "http://www.myapp.com"
# --- --- ---
/* mff.bookmarklet
version 0.0.6
*/
// Lazy initialize our namespace context: mff.bookmarklet
if (typeof(mff) == 'undefined') mff = { };
if (typeof(mff.cookie) == 'undefined') mff.cookie = { };
Base64 = {_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+S
@theinvensi
theinvensi / pagedjs-repeat-table-header.js
Last active May 5, 2024 16:08
pagedjs-repeat-table-header
class RepeatTableHeadersHandler extends Paged.Handler {
constructor(chunker, polisher, caller) {
super(chunker, polisher, caller)
this.splitTablesRefs = []
}
afterPageLayout(pageElement, page, breakToken, chunker) {
this.chunker = chunker
this.splitTablesRefs = []
@st4rdog
st4rdog / msi-afterburner-undervolt-how-to.md
Last active May 5, 2024 16:07
MSI Afterburner Voltage Curve Editor Tutorial - Undervolt

Tutorial

  • Start at default curve.
  • Ctrl-click-drag any point in right-half to bend it until a point intersects with desired mhz/voltage.
  • Select point and adjust to perfection using shift-up-down.
  • Shift-click-drag empty space and select points (including selected point) on the right. Selected point should be left-most point.
  • Shift-Enter twice to flatten all points in selection area. They will flatten to match the selected point.
  • Adjust if required.

Controls

@mackuba
mackuba / core_data_wwdc.json
Last active May 5, 2024 16:03
List of all WWDC talks about Core Data since 2010
[
{
"id": "wwdc2010-118",
"title": "Mastering Core Data",
"description": "Core Data contains a vast set of advanced features to help you better manage your data and evolve your application over time. Master the techniques for working with data in your application, from being more efficient to doing more in the database and changing how you store your data over time. Take your Core Data knowledge to the next level.",
"links": [
[
"HD",
"https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2010__hd/session_118__mastering_core_data.mov"
],