Skip to content

Instantly share code, notes, and snippets.

View seanogdev's full-sized avatar
💭
On AL

Seán O'Grady seanogdev

💭
On AL
View GitHub Profile
@cheeaun
cheeaun / ocr.sh
Last active December 30, 2024 10:25
macOCR script for Raycast. Preview https://twitter.com/cheeaun/status/1395973544983425025
#!/bin/bash
# Dependency: requires macOCR
# Download: https://github.com/schappim/macOCR
# @raycast.schemaVersion 1
# @raycast.title macOCR
# @raycast.mode silent
# @raycast.author Lim Chee Aun
# @raycast.authorURL https://github.com/cheeaun
@jasonkuhrt
jasonkuhrt / nexus-prisma reboot sketching.md
Last active February 26, 2021 03:15
Stream of consciousness design of the new Nexus Prisma

This sketch is outdated. Please refer to https://github.com/prisma/nexus-prisma for current spec & status.



Here is a GraphQL object manually projecting fields from the model layer. Assume the parent returned data of a project model.

objectType({
@getify
getify / 1.js
Last active March 19, 2023 08:32
tag function for formatting console.log(..) statements
function logger(strings,...values) {
var str = "";
for (let i = 0; i < strings.length; i++) {
if (i > 0) {
if (values[i-1] && typeof values[i-1] == "object") {
if (values[i-1] instanceof Error) {
if (values[i-1].stack) {
str += values[i-1].stack;
continue;
}
@DawidMyslak
DawidMyslak / vue.md
Last active April 22, 2024 12:49
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modifying state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.

@bendc
bendc / randomInterval.js
Created March 9, 2017 21:55
rAF-based random interval
const randomInterval = (() => {
const random = (min, max) => Math.random() * (max - min) + min;
return (callback, min, max) => {
const time = {
start: performance.now(),
total: random(min, max)
};
const tick = now => {
if (time.total <= now - time.start) {
time.start = now;
@hollodotme
hollodotme / Install-php7.md
Last active August 11, 2022 06:23
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
@joshangell
joshangell / default.vcl
Last active January 5, 2022 11:35
Varnish config for Craft
# Varnish 4.0 configuration for Craft
#
# Based on the following:
# - https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/blob/master/default.vcl
# - https://gist.github.com/aelvan/eba03969f91c1bd51c40
vcl 4.0;
import std;
import directors;
@jonathansimmons
jonathansimmons / base16.css
Last active February 3, 2020 08:36
Base 16 Ocean Dark Slack Theme
/* Not perfect but looks good considering slack limitations */
#2B2F3A,#1F232C,#1F232C,#DFE1E8,#4F5C65,#90A2B2,#A1C088,#C36069
@rossluebe
rossluebe / Twig Snippets for Atom
Created May 7, 2014 20:09
Twig Snippets for Atom
'.text.html.twig':
'Tag Print':
'prefix': '}}'
'body': '{{ $1 }}$0'
'Tag Block':
'prefix': '%%'
'body': '{% $1$2 %}$0{% end$1 %}'
'Tag Block (Block)':
@jhned
jhned / mza-snippet
Last active December 28, 2018 14:32
margin: 0 auto; gist for Emmet
{
"snippets": {
"css": {
"snippets": {
"mza": "margin: 0 auto;"
}
}
}
}