Skip to content

Instantly share code, notes, and snippets.

View thvd's full-sized avatar

Theodoor van Donge thvd

View GitHub Profile
import { Pipe } from 'angular2/core.js';
/**
* Map to Iteratble Pipe
*
* It accepts Objects and [Maps](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
*
* Example:
*
* <div *ngFor="#keyValuePair of someObject | mapToIterable">
@knation
knation / salesforceId.js
Created November 6, 2015 19:00
JavaScript Salesforce ID Check & Expansion
/**
* The regex for a SF ID.
* @type {RegExp}
* @const
*/
var ID_REGEX = /^[0-9a-zA-Z]{15}([0-9a-zA-Z]{3})?$/;
/**
* Array used to expand a SF ID from 15 to 18 characters.
* @type {Array.<String>}
@filviu
filviu / zfs_health.sh
Last active May 4, 2020 07:04
Original from: https://calomel.org/zfs_health_check_script.html The ZFS Health Check script You are welcome to copy and paste the following script. We call the script "zfs_health.sh", but you can use any name you wish. Make sure to set the script to be executable and define your full path to the bash shell binary at the top. Also, take a look at…
#!/bin/bash
#
# Calomel.org
# https://calomel.org/zfs_health_check_script.html
# FreeBSD 9.1 ZFS Health Check script
# zfs_health.sh @ Version 0.15
# Check health of ZFS volumes and drives. On any faults send email. In FreeBSD
# 10 there is supposed to be a ZFSd daemon to monitor the health of the ZFS
# pools. For now, in FreeBSD 9, we will make our own checks and run this script
@thvd
thvd / .gitignore
Created October 3, 2014 07:55
Salesforce gitignore
.project
.settings/
config/
*.sublime-*
mm.log
desktop.ini
@max
max / gist:9451566
Last active August 29, 2015 13:57

AngularJS vs Ember.js

I never had data to back up my hypothesis that AngularJS was going to overpower Ember.js despite its perceived inferiority. Here are some numbers:

Github

AngularJS Ember.js
Stars 21,345 9,557
Forks 6,636 2,041
@mvuksano
mvuksano / gist:8966280
Created February 12, 2014 22:58
Demo for dart issue #16779
void main(List<String> args) {
args.forEach((arg) => print('Argument: ${arg}'));
}
@dherman
dherman / loader-api.md
Last active January 31, 2019 03:02
Complete ES6 Loader API

Notational Conventions

This section describes the conventions used here to describe type signatures.

A [T] is an array-like value (only ever used read-only in this API), i.e., one with an integer length and whose indexed properties from 0 to length - 1 are of type T.

A type T? should be read as T | undefined -- that is, an optional value that may be undefined.

Loaders

import 'dart:async';
import 'package:postgresql/postgresql.dart';
void main() {
var username = "TheRightMan";
var password = "WithTheRightSecret";
var DBname = "AtTheRightPlace";
var uri = 'postgres://$username:$password@localhost:5432/$DBname';
@afawcett
afawcett / ant-salesforce.xml
Last active December 29, 2022 17:11
Defines some macros around sf:deploy to install and uninstall packages.
<!-- TODO: Review Ant v1.8 local properties -->
<project xmlns:sf="antlib:com.salesforce">
<!-- Download from Salesforce Tools page under Setup -->
<typedef
uri="antlib:com.salesforce"
resource="com/salesforce/antlib.xml"
classpath="${basedir}/lib/ant-salesforce.jar"/>
<!-- Download from http://sourceforge.net/projects/ant-contrib/files/ant-contrib/1.0b3/ -->
@drublic
drublic / rem-fallback.less
Last active March 28, 2020 23:57
Fallback rem-mixin in Sass and LESS
@main-font-size: 16px;
.x-rem (@property, @value) {
// This is a workaround, inspired by https://github.com/borodean/less-properties
@px-fallback: @value * @main-font-size;
-: ~`(function () { return ';@{property}: @{px-fallback}'; }())`;
-: ~`(function () { return ';@{property}: @{value}rem'; }())`;
}