Skip to content

Instantly share code, notes, and snippets.

Avatar
🦜
Focusing

Simon sp90

🦜
Focusing
View GitHub Profile
@zthomas
zthomas / intercom-delete-old-users.js
Last active Sep 18, 2020
Script to delete and clear old users from intercom. Useful for lowering the monthly bill
View intercom-delete-old-users.js
// License: MIT, feel free to use it!
const Intercom = require('intercom-client');
const appId = 'APP_ID'
const apiKey = 'APP_KEY'
const client = new Intercom.Client(appId, apiKey);
const async = require('async-q')
//REF: https://developers.intercom.com/reference#iterating-over-all-users
//WARNING: you can only have one scroll working at once. you need to wait for that scroll to clear to try again
@darisi
darisi / Gruntfile.js
Last active Sep 14, 2019
Uncss setting with grunt examples
View Gruntfile.js
uncss: {
dist: {
options: {
ignore: [
/(#|\.)fancybox(\-[a-zA-Z]+)?/,
/expanded/,
/js/,
/wp-/,
/align/,
/admin-bar/,
@Yimiprod
Yimiprod / difference.js
Last active Sep 27, 2020
Deep diff between two object, using lodash
View difference.js
/**
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
return _.transform(object, function(result, value, key) {
if (!_.isEqual(value, base[key])) {
@edouard-lopez
edouard-lopez / libsass-install.bash
Last active Oct 17, 2019
Installing/Compiling libsass and sassc on Ubuntu 14.04+/Linux Mint 17+ (needed by node-sass)
View libsass-install.bash
# Based on https://github.com/sass/libsass/wiki/Building-with-autotools
# Install dependencies
apt-get install automake libtool
# Fetch sources
git clone https://github.com/sass/libsass.git
git clone https://github.com/sass/sassc.git libsass/sassc
# Create configure script
@kwokhou
kwokhou / angular-autoNumeric.js
Last active Mar 12, 2019
AngularJS directive for autoNumeric.js
View angular-autoNumeric.js
// Directive for autoNumeric.js
// Require AngularJS, jQuery and autoNumeric.js
angular.module('crunch.ui.numeric', []).directive('crNumeric', [function () {
'use strict';
// Declare a empty options object
var options = {};
return {
// Require ng-model in the element attribute for watching changes.
require: '?ngModel',
// This directive only works when used in element's attribute (e.g: cr-numeric)
@acusti
acusti / dropdown-touch.js
Last active Jul 11, 2017
Plain vanilla JS with no dependencies to add touch device support for drop down menus (nested unordered list style). CSS selectors to display nested `<ul>` should look like: `body.no-touch ul.menu > li:hover > ul, ul.menu > li.tapped > ul { display: block; }`
View dropdown-touch.js
(function(doc) {
// Add touch device support for dropdown menu
if (('addEventListener' in doc) && ('querySelectorAll' in doc) && (('ontouchstart' in window) || ('onmsgesturechange' in window))) {
var menu_item_selector = '.the-menu > div > ul > li',
menu_items = doc.querySelectorAll(menu_item_selector),
touchStart;
// Set up touch start handler
touchStart = function() {
if (this.className.indexOf(' tapped') > -1) {
You can’t perform that action at this time.