Skip to content

Instantly share code, notes, and snippets.

@ffxsam
ffxsam / Suspense.ts
Last active November 27, 2023 23:30
Vue 3's Suspense component, ready for use in Vue 2.x (TypeScript)
import Vue from 'vue';
export const Suspense = Vue.extend({
name: 'Suspense',
data: () => ({
resolved: false,
}),
async created() {
const setupMethod = (this.$parent as any).setup;
if (!setupMethod) {
@BenjyWiener
BenjyWiener / ReplayKit.py
Last active September 7, 2017 04:34
ReplayKit.py
# coding: utf-8
from objc_util import *
from Foundation import NSBundle
NSBundle.bundleWithPath_('/System/Library/Frameworks/ReplayKit.framework').load()
RPScreenRecorder = ObjCClass('RPScreenRecorder')
@aceakash
aceakash / .eslintrc
Created July 26, 2015 10:05
ESLint Configuration for Node.js/ES6
{
"rules": {
"indent": [2, 2],
"quotes": [2, "single"],
"linebreak-style": [2, "unix"],
"semi": [2, "always"],
"no-underscore-dangle": 0,
"curly": 0,
"no-use-before-define": [2, "nofunc"],
"spaced-comment": [2, "always"],
@tkadlec
tkadlec / perf.js
Created April 23, 2015 11:54
Super simple example of adding perf timing to the page display during dev work
(function () {
var perfBar = function(budget) {
window.onload = function() {
window.performance = window.performance || window.mozPerformance || window.msPerformance || window.webkitPerformance || {};
var timing = window.performance.timing,
now = new Date().getTime(),
output, loadTime;
// Drafts 4 script step to create custom tags
// using the a line or a default value if that line is empty or missing
// split draft into an array of lines
var lines = draft.content.split('\n');
// reusable function to define tag based on line or default string
function createLineTag(lineNumber,default) {
var tagName = "line"+(lineNumber+1).toString();
if(lines[lineNumber] && lines[lineNumber].length > 0) {
@dstroot
dstroot / app.js
Created July 13, 2014 16:29
Gulp, BrowserSync, Node, and Nodemon all working in harmony. ;)
/**
* World's simplest express server
* - used to serve index.html from /public
*/
var express = require('express');
var serveStatic = require('serve-static');
var app = express();
app.use(serveStatic(__dirname + '/public'));
@kevinSuttle
kevinSuttle / app.js
Last active February 26, 2024 07:02
Gulp, BrowserSync, Sass, Autoprefixer, Nodemon
var express = require('express');
var app = express();
var router = express.Router();
var hbs = require('hbs');
app.set('view engine', 'html');
app.engine('html', hbs.__express);
app.use(express.json());
app.use(express.urlencoded());
#!/usr/bin/env ruby
# merge_asana_into_omnifocus.rb
# Hilton Lipschitz
# http://www.hiltmon.com
# Use and modify freely, attribution appreciated
# Script to import Asana projects and their tasks into
# OmniFocus and keep them up to date from Asana.
@ramv
ramv / kirby.conf
Created March 6, 2014 23:49
Kirby NGINX configuration
##############################
## Kirby configuration
##############################
location /kirby/ {
include /etc/nginx/mime.types;
index index.php;
root /var/www/addons88/;
if (!-e $request_filename){
// --------------------------------------------------------------------------------------
// A More Modern Scale for Web Typography
// Based on this article: http://typecast.com/blog/a-more-modern-scale-for-web-typography
// --------------------------------------------------------------------------------------
$body-font-size: 1em !default;
// Adjusts body typography to be default
// for each browser.
@mixin reset-body-font-size($font-size: 100%, $size-adjustment: 0.5) {