Skip to content

Instantly share code, notes, and snippets.

View pongstr's full-sized avatar
:octocat:

pongstr pongstr

:octocat:
View GitHub Profile
@katowulf
katowulf / app.js
Last active February 24, 2022 06:51
Simple paginate example in AngularFire with Firebase.util (http://firebase.github.io/firebase-util/)
var app = angular.module('app', ['firebase']);
app.controller('ctrl', function($scope, $pageArray) {
$scope.pageItems = $pageArray(ref, 'number');
});
app.factory('$pageArray', function($firebaseArray) {
return function(ref, field) {
// create a Paginate reference
var pageRef = new Firebase.util.Paginate(ref, field, {maxCacheSize: 250});
@nolanlawson
nolanlawson / rant.md
Last active March 1, 2023 23:34
Misconceptions about PouchDB

Misconceptions about PouchDB

A quick rant.

  1. PouchDB is slow, because it doesn't use bare-metal IndexedDB

OK, first off I want to point out the CanIUse table for IndexedDB. Go ahead, look at it. I'll wait.

@itsvicsoto
itsvicsoto / angular.md
Last active December 15, 2018 17:54
[cheatsheet] Angular 1.3.9
@paulirish
paulirish / args.gn
Last active May 17, 2024 00:09
How to build Chromium to hack on DevTools
# Build arguments for the gn build
# You can set these with `gn args out/Default`
# ( and they're stored in src/out/Default/args.gn )
# See "gn args out/Default --list" for available build arguments
# component build, because people love it
is_component_build = true
# release build, because its faster
is_debug = true
@frdmn
frdmn / osx-10-10-virtualbox.md
Last active February 22, 2022 08:39
Install OS X 10.10 Yosemite in VirtualBox
@jaf0
jaf0 / qs.js
Created August 1, 2014 15:32 — forked from jonmaim/qs.js
/* Converts an object into a key/value par with an optional prefix. Used for converting objects to a query string */
var qs = function(obj, prefix){
var str = [];
for (var p in obj) {
var k = prefix ? prefix + "[" + p + "]" : p,
v = obj[p];
str.push(angular.isObject(v) ? qs(v, k) : (k) + "=" + encodeURIComponent(v));
}
return str.join("&");
}

Dotfiles Lite

Taken from mathiasbynens/dotfiles. Save time and pain from customising your clean-installed Mac, install web development tools and native applications. It's straight-forward and simple, here's how you run it:

Download osx.sh and tools.sh to your desktop, open osx.sh on your favorite text editor and change these lines:

# Set computer name (as done via System Preferences → Sharing)
sudo scutil --set ComputerName "benjaminbasa"
@jtrussell
jtrussell / index.html
Last active August 12, 2019 15:05
jsbin - AngularJS, basic template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Angular JS</title>
</head>
<body ng-app="jsbin">
<div ng-controller="DemoCtrl as demo">
<h1>Hello {{demo.name}}</h1>
</div>
/**
* Возвращает по дате номер TD в таблице
* Использование:
* var td = table.find('td').eq(getCellByDate(date))
*/
function getCellByDate(date) {
var date1 = new Date(date.getFullYear(), date.getMonth(), 1);
return getDay(date1) + date.getDate() - 1;
}
@walesmd
walesmd / IconServiceAgent.md
Last active December 13, 2023 05:06
A lot of people are having issues with com.apple.IconServicesAgent. Since this is a very new issue, Google was no help and `man iconservicesd` is even more hilarious. I eventually fixed it, when I was working on a completely different issue (that is still not fixed). The instructions are below and on the Apple Support Forum, https://discussions.…

I was chasing down another issue (slow "Save As") and thought these two issues may have been related (with QuickLook being the common broken link). Unfortunately, my "Save As" dialog is still miserably slow on the initial load; but IconServicesAgent hasn't gone above 30MB and he rarely makes an appearance in the Console!

Some of these steps may not be necessary, but here are all of the steps I took that inadverdently put IconServicesAgent back in its place. Note: all commands are a single-line, if they appear to be multiple that's just the forum formatting.

  1. Check for any QuickLooks related .plist files. In a terminal: mdfind com.apple.quicklook. -name .plist

  2. I only had files at the system level (specifically within /System/Library/LaunchAgents/). If you have others, modify the directions below to take that into account (re-introducing plist files from the system level back up to the user).

  3. Make some temporary directories to store these plist files, just in case: mkdir ~/tmp-quicklook