Skip to content

Instantly share code, notes, and snippets.

View dayAlone's full-sized avatar

Andrey Kolmakov dayAlone

View GitHub Profile
@bastsoft
bastsoft / load.js
Last active November 28, 2016 04:52
javascript:(function(){
var el = document.createElement('script');
el.onload = el.onreadystatechange = function () {
if (el.readyState && el.readyState !== "complete" && el.readyState !== "loaded") {
return false;
}
btr.loadGist({ id: '1e363e357fe247b4db36b5e8fdd2243c', file: 'main.js' });
};
document.getElementsByTagName('head')[0].appendChild(el).src = 'https://cdn.rawgit.com/bastsoft/btr/v0.1.0/btr.js';
})();

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@stefanschmidt
stefanschmidt / disable-tunnelbear-icon.sh
Created May 2, 2014 12:47
Disable Tunnelbear dock icon on OS X 10.9 Mavericks
/usr/libexec/PlistBuddy /Applications/TunnelBear.app/Contents/Info.plist -c "Add LSUIElement String"
/usr/libexec/PlistBuddy /Applications/TunnelBear.app/Contents/Info.plist -c "Set LSUIElement 1"
sudo codesign -f -s - /Applications/TunnelBear.app
@romansklenar
romansklenar / crosstab.sql
Last active February 1, 2023 18:46
PostgreSQL "pivot table" example using tablefunc extension
CREATE EXTENSION tablefunc;
CREATE TABLE sales(year int, month int, qty int);
INSERT INTO sales VALUES(2007, 1, 1000);
INSERT INTO sales VALUES(2007, 2, 1500);
INSERT INTO sales VALUES(2007, 7, 500);
INSERT INTO sales VALUES(2007, 11, 1500);
INSERT INTO sales VALUES(2007, 12, 2000);
INSERT INTO sales VALUES(2008, 1, 1000);
INSERT INTO sales VALUES(2009, 5, 2500);
@Angles
Angles / some iOS browser URI launching JS snippets.js
Last active August 2, 2024 07:38
"Open In" Bookmarklets for iOS
/* WITH MODS TO ORIG -- iOS Browser Bookmarklets to launch other apps and stuff */
/* ver 2014-04-14a */
/* backing up my "Open In" bookmarks */
// note iOS6 requires some changes to these
// BEGIN TESTING STUFF -- IN PROFRESS LIKELY NOT WORKING
// SOME WORK, MOST tests are not WORK --
// PINNER APP TEST STUFF (as a private one)
// the page title as the title and your selected text as the description.