Skip to content

Instantly share code, notes, and snippets.

@jakebellacera
jakebellacera / ICS.php
Last active June 2, 2024 02:20
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@marcoleong
marcoleong / bootstrap-scrollspy-horizontal.js
Created February 27, 2012 09:22
Modified bootstrap-scrollspy.js to support horizontal scroll.
/* =============================================================
* bootstrap-scrollspy.js v2.0.1
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
* =============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@kenkubiak
kenkubiak / Sprite.php
Created September 4, 2012 22:56
Building an SVG Sprite from SVG icon assets ... in PHP
<?php
/**
* Create an SVG sprite as a DOMDocument.
*/
class Sprite {
/**
* The URI for the SVG namespace.
*
@marcialca
marcialca / Creating and Deploying using Git Github and PHP
Created October 2, 2012 06:07
Creating and Deploying using Git, Github and PHP
/** Creating and Deploying using Git, Github and PHP **/
Prerequisites:
Server: SSH Acces, PHP, Git
Local: SSH, Git
0.Create a PHP file in your project called "deploy.php" with this content: /*<?php `git pull`;*/
1. Create Your Github Repo
2. Go to your project folder and initiate a git repository
@terkel
terkel / _decimal.scss
Last active November 23, 2023 18:36
Rounding decimals in Sass
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
// Round a number to specified digits.
//
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @param {String} [$mode:round] (round|ceil|floor) How to round a number
// @return {Number} A rounded number
// @example
// decimal-round(0.333) => 0
@robinnorth
robinnorth / wordpress_export-post-data.php
Created April 26, 2013 11:44
WordPress: Simple, configurable script to export post data to a CSV file
<?php
/**
* Export WordPress post data to CSV
* Based on <http://stackoverflow.com/a/3474698> and <http://ran.ge/2009/10/27/howto-create-stream-csv-php/>
*/
/**
*********************************************************************
* Configuration
*********************************************************************
@Cerdic
Cerdic / site-desactive-plugin.php
Last active December 18, 2015 21:38
Desactiver des plugins d'un site SPIP depuis la ligne de commande. Lancer le script depuis la racine du site SPIP, ou depuis le dossier ecrire/ ou le dossier plugins/
#!/usr/bin/php
<?php
$desactiver = $argv;
array_shift($desactiver);
if (!is_dir('ecrire/') AND is_dir('../ecrire/')) chdir('../');
chdir('ecrire/');
if (!defined('_DIR_RESTREINT_ABS')) define('_DIR_RESTREINT_ABS', '');
@Cerdic
Cerdic / site-active-plugin.php
Last active December 18, 2015 21:38
Permet d'activer des plugins d'un site SPIP depuis la ligne de commande. Lancer le script depuis la racine du site ou depuis ecrire/ ou plugins/
#!/usr/bin/php
<?php
$activer = $argv;
array_shift($activer);
if (!is_dir('ecrire/') AND is_dir('../ecrire/')) chdir('../');
chdir('ecrire/');
if (!defined('_DIR_RESTREINT_ABS')) define('_DIR_RESTREINT_ABS', '');
@neilgee
neilgee / git.css
Last active December 7, 2023 02:08
Git Command Line Reference - Notes, Cheatsheet and reminders on Git set up and commands
/*
* Set up your Git configuration
*/
git config --global user.email "you@yourdomain.com"
git config --global user.name "Your Name"
git config --global core.editor "nano"
@apfelbox
apfelbox / Parser.php
Last active August 12, 2016 09:59
Adjusted parser to render paragraphs which only contain a single image without the paragraph. So instead <p><img ...></p> it just renders<img ...>
<?php
/**
* Adjusted parser to render paragraphs which only contain a single image without the paragraph.
*
* So instead
* <p><img ...></p>
*
* it just renders
* <img ...>