Skip to content

Instantly share code, notes, and snippets.

View endymion1818's full-sized avatar
🦈
47

Ben Read endymion1818

🦈
47
View GitHub Profile
@coderbyheart
coderbyheart / import-to-contentful.js
Created May 30, 2017 14:21
Import jekyll content for contenful
const glob = require('glob')
const fs = require('fs')
const parser = require('jekyll-markdown-parser')
const contentful = require('contentful-management')
const client = contentful.createClient({
accessToken: '…'
})
// This API call will request a space with the specified ID
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
.cloud {
@for $i from 1 through 3 {
$new-position: 10*$i;
li:nth-of-type(#{$i}) {
background-image: url("http://krystalcampioni.com/talk/clouds.svg");
top: -(#{$new-position})+(vh); // repositioning each cloud on top of each other
animation-duration: (10*$i)+(s); // each layer will have a different speed
opacity: (.25*$i); // clouds close to the camera will be more transparent
background-repeat: repeat-x; // use repeat-x to create an infinite background-scroll
@jeherve
jeherve / plugin.php
Last active May 14, 2016 00:59
[Jetpack] Remove all CSS.
<?php
// First, make sure Jetpack doesn't concatenate all its CSS
add_filter( 'jetpack_implode_frontend_css', '__return_false' );
// Then, remove each CSS file, one at a time
// You probably won't need them all, unless you use all the modules, and all the themes! :)
// Some of these are also only loaded on specific admin pages, so it wouldn't affect your readers
function jeherve_remove_all_jp_css() {
wp_deregister_style( 'AtD_style' ); // After the Deadline
@aamnah
aamnah / lamp.sh
Last active February 19, 2024 11:51
Bash script to install Apache, MySQL and PHP as well as PHPMyAdmin and some tweaks. For Debian and Ubuntu. To run, copy the script to the server and run ``bash lamp.sh``
#!/bin/sh
#######################################
# Bash script to install an AMP stack and PHPMyAdmin plus tweaks. For Debian based systems.
# Written by @AamnahAkram from http://aamnah.com
# In case of any errors (e.g. MySQL) just re-run the script. Nothing will be re-installed except for the packages with errors.
#######################################
#COLORS
%reset-Button {
border: none;
margin: 0;
padding: 0;
width: auto;
overflow: visible;
background: transparent;
/* inherit font & color from ancestor */
@ramseyp
ramseyp / hide-editor.php
Created November 12, 2012 15:48
Hide the content editor for certain pages in WordPress
<?php
/**
* Hide editor on specific pages.
*
*/
add_action( 'admin_init', 'hide_editor' );
function hide_editor() {
// Get the Post ID.