Skip to content

Instantly share code, notes, and snippets.

View peschee's full-sized avatar
Grabbing another coffee…

Peter Siska peschee

Grabbing another coffee…
View GitHub Profile
<?php
namespace Acme\HelloBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class MenuBuilder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)
@peschee
peschee / gist:3db1a4ab69ad72e79740
Last active August 29, 2015 14:18
JIRA bug report update script
<script type="text/javascript">
(function ($) {
$(function () {
var descriptionTemplate = "What URL were you on? Who were you logged in as? Is there anything else about your environment that is important (Browser, Browser Version)?\n\nh3. What did you expected it to do?\n\nh3. What did it actually do?\n\nh3. What are the detailed steps to recreate this behavior?\n\n# Step 1\n# Step 2\n# Step 3\n# ...";
var updateDescription = function updateDescription($issueTypeField, $description) {
if ($issueTypeField.length > 0 && $description.length > 0) {
var issueType = $issueTypeField.get('selector') === '#issue-create-issue-type' ? $issueTypeField.html() : $issueTypeField.val();
// Update description
  1. ssh in to your Synology
  2. $ vi /root/.profile
  3. prepend /opt/bin:/opt/sbin: to PATH so it looks like PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
    replace the standard rdiff packages with symlinks:
  4. $ ln -s /opt/bin/rdiff-backup-2.6 /usr/bin/rdiff-backup
  5. $ ln -s /opt/bin/rdiff-backup-statistics-2.6 /usr/bin/rdiff-backup-statistics
@peschee
peschee / Default (OSX).sublime-keymap -- User
Created February 3, 2016 13:24 — forked from coldnebo/Default (OSX).sublime-keymap -- User
Sublime Text 2 fix for OSX home/end keys
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} }
@peschee
peschee / setup-es6-linting.md
Created February 4, 2016 08:50
Linting ES6+Babel+JSX in Atom

Setup ES6+Babel+JSX Linting with Atom

This sets up Atom to properly lint ES6+Babel+JSX using Airbnb's .eslintrc as a starting point.

Steps

  1. Download Atom and get these two packages: Linter and [Linter-ESLint)(https://atom.io/packages/linter-eslint)
  2. Run npm install --save-dev eslint-config-airbnb babel-eslint eslint-plugin-react from your project root.
  3. Add "extends": "eslint-config-airbnb" to your .eslintrc
add-apt-repository -y ppa:ondrej/apache2
apt-key update
apt-get update && apt-get upgrade
apt-get install apache2
@peschee
peschee / readme.md
Created March 1, 2016 13:24 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

@peschee
peschee / gist:50873ff347dfe370e35e
Created March 7, 2016 18:43
By default the member limit on Node js is 512 mb. This will cause FATAL ERROR- JS Allocation failed – process out of memory when processing large data files. It can be avoided by increasing the memory limit.
node --max-old-space-size=1024 my-node-script.js # increase to 1gb
node --max-old-space-size=2048 my-node-script.js # increase to 2gb
node --max-old-space-size=3072 my-node-script.js # increase to 3gb
node --max-old-space-size=4096 my-node-script.js # increase to 4gb
node --max-old-space-size=5120 my-node-script.js # increase to 5gb
node --max-old-space-size=6144 my-node-script.js # increase to 6gb
node --max-old-space-size=7168 my-node-script.js # increase to 7gb
node --max-old-space-size=8192 my-node-script.js # increase to 8gb
@peschee
peschee / gist:4b0a2f202754f0bdfd86
Created March 12, 2016 21:31
Disable / enable notification center osx capitan
# Taken from http://www.tekrevue.com/tip/how-to-completely-disable-notification-center-in-mac-os-x/
# disable
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
# enable
launchctl load -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
#!/usr/bin/env ruby
# A quick script to download all your files from CloudApp.
# To run this just run the script passing your e-mail & password
# to the script, for example:
#
# gem install cloudapp_api
# ruby cloudapp-export.rb [email protected] mypassword
#