Skip to content

Instantly share code, notes, and snippets.

@magicznyleszek
magicznyleszek / jekyll-and-liquid.md
Last active January 12, 2024 03:46
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@nitriques
nitriques / sync-starter-kit.sh
Last active March 16, 2018 22:54
sync-starter-kit.sh
#!/bin/bash
#function syncsk27 {
# pwd=`pwd`;
# cd /q;
# ./sync-starter-kit.2.7.sh $@;
# cd $pwd;
#}
VERSION=2.3.0
@joyrexus
joyrexus / README.md
Last active February 19, 2024 17:15 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
// After making the required edits below, use something like http://daringfireball.net/2007/03/javascript_bookmarklet_builder to create the bookmarklet.
(function(){
var form=document.createElement("form");
// Edit the action value to match your domain and section names.
form.setAttribute("action","http://example.com/symphony/publish/entries/new/");
form.setAttribute("method","post");
// Edit the params to match your auth-token
// (found on the author page) and section fields.
@kenzie
kenzie / craft.conf
Last active May 17, 2018 17:48
Nginx virtual host configuration for Craft CMS, PHP5-FPM, NGINX 1.2.1 and craft/config/general.php for friendly URLs.
server {
listen 80;
root /var/www/craft.dev/public;
index index.php index.html index.htm;
server_name craft.dev;
location / {
try_files $uri $uri/ @rewrites;
@jofralogo
jofralogo / responsiveMixinsF4.sass
Last active December 15, 2015 21:18
Useful responsive SCSS mixins for Foundation 4.
/*
_______
These simple SCSS/SASS mixins for Foundation 4 are made by me to deal with media-queries and have a clean code at the same time! ;)
****IMPORTANT****
Due to Foundation 4 uses mobile-first methodology, every $phone-"X" variable in these mixins defines the value for every screen size.
$desktop-"X" values overrides $phone-"X" values when the width of the window is 768px and above.
@bzerangue
bzerangue / array2xml.php
Last active June 28, 2023 04:29
Decoding JSON to a PHP Array and then converting it to XML.
<?php
/**
* Array2XML: A class to convert array in PHP to XML
* It also takes into account attributes names unlike SimpleXML in PHP
* It returns the XML in form of DOMDocument class for further manipulation.
* It throws exception if the tag name or attribute name has illegal chars.
*
* Author : Lalit Patel
* Website: http://www.lalit.org/lab/convert-php-array-to-xml-with-attributes
* License: Apache License 2.0
@bzerangue
bzerangue / recursive-md.php
Last active July 24, 2020 17:39
Recursively search through a directory (and it's children directories) to find Markdown files and convert the list of files and their content and into an XML document.
<?php
#
# INSPIRATION FROM Nick Dunn (in the Symphony CMS forum)
# "Convert a Directory of Markdown Text Files for Dynamic XML Datasource Use"
# http://getsymphony.com/discuss/thread/60701/#position-2
#
# AND FROM Stack Overflow
# http://stackoverflow.com/questions/8545010/php-reading-first-2-lines-of-file-into-variable-and-cylce-through-subfolders/8545451#8545451
#
@designermonkey
designermonkey / data_1.xml
Created February 12, 2013 23:06
Using Names and Matches together in XSL templates, we can choose and apply templates dynamically, based on content provided within the XML being transformed. I've searched for ages on how to do this properly, and a number of sources led me to this solution.
<data>
<datasource>
<section handle="test-section">Test Section</section>
<entry>
<page-path handle="about">/about</page-path>
<page-title handle="about">About</page-title>
<title handle="about-this-company">About This Company</title>
<template>
<item id="2" handle="content" section-handle="page-templates" section-name="Page Templates">Content</item>
</template>