Skip to content

Instantly share code, notes, and snippets.

@scy
scy / delete-from-repo.md
Created September 20, 2013 11:54
How to delete a file from a Git repository, but not other users' working copies

How to delete a file from a Git repository, but not other users' working copies

Suppose you have, by mistake, added your IDE's project folder (you know, these .idea folders with all kinds of local paths and configuration data and settings in it) to the Git repository of your project. (We're talking about a whole folder here, but the same rules apply to individual files as well.)

Of course, you only realize that two days after the fact and have already pushed it, and your colleagues have already pulled it. They use the same IDE as you do, so whenever they change a setting or fix paths, they can either

  • commit that, causing nasty merge conflicts for you and others or
  • ignore the changes and carry around a modified file until the end of time without ever committing it.

Why .gitignore won't help

@firegoby
firegoby / data.xml
Created September 11, 2013 19:50
Minimalist example for getting my fork of BBC News' Imager.js (https://github.com/firegoby/Imager.js) working with Symphony CMS
<images>
<file size="345 KB" path="/images" type="image/jpeg">
<filename>1z9x6l7.jpg</filename>
<meta creation="2013-09-11T13:39:53+01:00" width="2560" height="1440" />
</file>
<file size="367 KB" path="/images" type="image/jpeg">
<filename>adfp6hk.jpg</filename>
<meta creation="2013-09-11T13:40:30+01:00" width="1920" height="1280" />
</file>
<file size="4.15 MB" path="/images" type="image/jpeg">
@bzerangue
bzerangue / composer.json
Last active December 22, 2015 18:39
Composer file for Symphony CMS Extensions
{
"name": "bmz/pcpc",
"description": "PCPC Main Site",
"config": {"vendor-dir": "extensions"},
"repositories": [
{
"type": "package",
"package": {
"name": "export_ensemble",
"version": "dev-master",
// 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.
@croxton
croxton / entries_archive.md
Last active April 8, 2018 01:30
Sort a list of entries by year and then by month
	{exp:stash:set_list name="entries" parse_tags="yes"}
		{exp:channel:entries channel="my_channel" orderby="date" sort="desc" dynamic="no" limit="999"}
		    {stash:title}{title}{/stash:title}
		    {stash:date_day}{entry_date format="%d"}{/stash:date_day}
		    {stash:date_month}{entry_date format="%m"}{/stash:date_month}
		    {stash:date_year}{entry_date format="%Y"}{/stash:date_year}
		    {stash:date_sort}{entry_date format="%Y-%F"}{/stash:date_sort}
		    {stash:date_machine}{entry_date}{/stash:date_machine}
		{/exp:channel:entries}

{/exp:stash:set_list}

@JeffreyWay
JeffreyWay / gist:6176883
Created August 7, 2013 18:19
Add this to your bash_profile. Now, whenever you need to fetch your ssh-key, just type sshkey, and it'll be copied to your clipboard.
alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy && echo 'Copied to clipboard.'"
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 27, 2025 16:31
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

## Getting Started
* Introduction
* Installing & Updating
- Requirements
- Installing
- Updating
* Licensing
* CP Overview
* Packages & Plugins
@n1k0
n1k0 / console-toggle.sublime-keymap
Created June 28, 2013 20:57
Toggle the Sublime Text console the same way you do with the Firefox devtools (⌘ + ⌥ + k)
[
{ "keys": ["command+alt+k"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },
]
@ericlbarnes
ericlbarnes / foreach_limit.blade.php
Last active July 13, 2023 07:51
Limit a foreach with Laravel blade
@foreach (array_slice($posts->toArray(), 0, 5) as $post)
<h1>{{ $post['title'] }}</h1>
@endforeach