Skip to content

Instantly share code, notes, and snippets.

View hacknug's full-sized avatar
👽

Nestor Vera hacknug

👽
View GitHub Profile
// Should I be ES6+ing this file? Does it matter? Seems like it would feel nicer but running Babel over this file feels like ouroboros.
// I'm using Gulp 3.x. I couldn't for the life of me get Gulp 4.x going, I think because my Gulp CLI was at too high (??) of a version and no amount of uninstalling and reinstalling would bring it back down.
var gulp = require("gulp");
// I thought I needed this until I found out about gulp.series. Can I refactor anything here?
var runSequence = require("run-sequence");
// Would this be a speed boost for anything? As in, only looking at files that have changed instead of all files?
// https://github.com/sindresorhus/gulp-changed
@lbssousa
lbssousa / Example_of_use.vue
Last active July 8, 2019 10:50
Vue component wrapper around parallax-js
<template>
(...)
<parallax-scene :scalar-x="25" :scalar-y="15">
<parallax-layer :depth="0.00">
<img src="~assets/parallax/0_sun.png" style="position: relative; top: -4px;" draggable="false" alt="">
</parallax-layer>
<parallax-layer :depth="0.33">
<img src="~assets/parallax/1_mountains.png" style="position: relative; top: 40px;" draggable="false" alt="">
</parallax-layer>
<parallax-layer :depth="0.67">
<template lang="pug">
button.py-2.px-3.rounded.tran-colors-p1.relative.overflow-hidden(
@click="click",
:class="[themes[theme], cursor]")
.flex.items-center.tran-opacity-p5(:class="{'opacity-25': loading, 'opacity-0': success}")
.mdi(v-if="icon",:class="[`mdi-${icon}`, label ? 'mr-2' : '']")
img.w-4.h-4(v-if="image",:src="image",:class="label ? 'mr-2' : ''")
div(v-if="label") {{ label }}
.bg-white-o3.button-loadbar.ani-zi(v-if="loading")
.absolute.inset-0.flex.items-center.justify-center(v-if="success")
function custom_theme_assets() {
// bail if classic editor setting is set to block or no-replace
$option = get_option( 'classic-editor-replace' );
if ( $option === 'block' || $option === 'no-replace' ) {
return;
}
// bail if classic editor plugin is not active. can't use is_plugin_active() here, unless you include wp-admin/includes/plugin.php
if ( ! in_array( 'classic-editor/classic-editor.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
return;
@gahabeen
gahabeen / FormulateForm.js
Last active September 17, 2020 04:56
Extended FormulateSchema/FormulateForm Component as Plugin - for the amazing VueFormulate lib
import FormulateForm from './FormulateForm.vue'
export function plugin(instance) {
instance.extend({
components: {
FormulateForm,
},
})
}
const { setContext } = require('apollo-link-context');
const { HttpLink } = require('apollo-link-http');
const { introspectSchema, makeRemoteExecutableSchema } = require('graphql-tools');
const fetch = require('node-fetch');
module.exports = function(api) {
api.createSchema(async function(graphql) {
const http = new HttpLink({
uri: 'http://example.com/api',
fetch
@vinnymac
vinnymac / fetchNames.js
Last active January 22, 2021 05:49
Pokemon Names
#!/usr/bin/env node
const http = require('http')
const fs = require('fs')
const url = 'http://pokeapi.co/api/v2/pokemon-species/'
let results = []
const receivedAllResults = () => {
const filename = './names.json'
const WordpressPurgeCSS = {
whitelist: [
"rtl",
"home",
"blog",
"archive",
"date",
"error404",
"logged-in",
"admin-bar",
anonymous
anonymous / colour_ring.pde
Created May 19, 2016 15:14
// by davey whyte aka @beesandbombs
void setup(){
size(600,520,P3D);
colorMode(HSB,1);
noStroke();
}
float R = 160, r = 55;
int N = 720;
@dasilvaluis
dasilvaluis / gulpfile.js
Last active September 27, 2021 09:34
Gettext Scanner Gulp Script for Twig Projects
/**
* Gettext Scanner Script for Twig Projects
* v1.3
*
* Developed by Luís Silva
* https://github.com/luism-s
*/
/**
* Purpose: