Skip to content

Instantly share code, notes, and snippets.

View bartholomej's full-sized avatar
:octocat:
🥛

BART! bartholomej

:octocat:
🥛
View GitHub Profile
<?php
$output = '';
$tElementClass = !empty($tElementClass) ? $tElementClass : 'modSnippet';
$tStart = $modx->getMicroTime();
if (!empty($tElement)) {
switch ($tElementClass) {
case 'modChunk':
$output = $modx->getChunk($tElement, $scriptProperties);
break;
@goldsky
goldsky / tv-counter.php
Created December 24, 2013 08:47
Count how many resources which have specified TV that has specified value
<?php
$name = $modx->getOption('name', $scriptProperties);
$value = $modx->getOption('value', $scriptProperties);
if (empty($tvName) || empty($value)) {
return;
}
$tvObj = $modx->getObject('modTemplateVar', array(
'name' => $name
));
@danomanion
danomanion / hide-cursor.css
Created August 27, 2013 03:12
Hide the cursor. Webkit code.
:-webkit-full-screen .slides{
cursor:url(data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==), auto;
}
@timgit
timgit / megaNumber.js
Last active January 15, 2020 08:35
Large number format filter for Angular written in ES6 that rounds to the specified decimal place (defaults to 1). 1 billion => 1B, 1,490,000 => 1.5M, 999,999 => 1M
angular.module('utilsModule').filter("megaNumber", () => {
return (number, fractionSize) => {
if(number === null) return null;
if(number === 0) return "0";
if(!fractionSize || fractionSize < 0)
fractionSize = 1;
var abs = Math.abs(number);
@seveves
seveves / Angular2 Preload Image
Last active January 21, 2020 22:24
Angular2 Show placeholder base64 image source till image is fully loaded
This component shows a smaller image or a base64 encoded image till the bigger version is fully loaded.
Added a blur/fade effect for the transition.
@adrienjoly
adrienjoly / ._release-to-chrome-web-store.sh
Last active March 26, 2020 01:09
This script creates a ZIP archive of a Chrome extension, then uploads it to the Chrome Web Store.
#!/bin/sh
# This script creates a ZIP archive of this extension
# and uploads it to the Chrome Web Store.
# it requires environment variables: APP_ID, CLIENT_ID, and CLIENT_SECRET
# (see https://developer.chrome.com/webstore/using_webstore_api)
source .env
VERSION=$(jq --raw-output .version manifest.json)
const functions = require('firebase-functions')
const URL_THE_GUARDIAN = "https://www.theguardian.com/uk/london/rss"
const Client = require('node-rest-client').Client
const client = new Client()
exports.fetch = functions.https.onRequest((req, res) => {
client.get(URL_THE_GUARDIAN, function (data, response) {
const items = cleanUp(data)
res.status(201)
@bjorgvino
bjorgvino / yosemite ntfs read+write.txt
Last active December 2, 2021 03:58
osxfuse + ntfs-3g + Yosemite = NTFS R/W
Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
Reboot (optional but recommended by osxfuse)
Install ntfs-3g via homebrew:
> brew update && brew install ntfs-3g
@iansym
iansym / jsonview-solarized.css
Last active September 13, 2022 21:33
JSON View solarized theme for Chrome Extension
body {
background-color: #002b36;
color: #839496;
font-size: 14px;
white-space: pre !important;
font-family: "Source Code Pro", monospace;
}
.property {
font-weight: bold;