Skip to content

Instantly share code, notes, and snippets.

View hacfi's full-sized avatar

hacfi hacfi

  • Certified Symfony developer
  • Europe
View GitHub Profile
@marcj
marcj / do-it.sh
Last active April 12, 2020 08:47
OSX PhpStorm, better performance - more FPS using OpenGL
cp /Applications/PhpStorm.app/Contents/bin/phpstorm.vmoptions ~/Library/Preferences/WebIde*
echo -ne "\n-Dawt.useSystemAAFontSettings=lcd\n-Dawt.java2d.opengl=true" >> ~/Library/Preferences/WebIde*/phpstorm.vmoptions
@Jbot29
Jbot29 / gist:b84e5e2c6275d963f7f6
Last active December 30, 2024 23:52
Ecommerce User Stories + Steps

#User Stories - Overview

  1. Authentication: User can signup/login/logout

  2. Items for sale: User can view lists of items for sale and search by name, filter by price.

  3. Shopping Cart: User can add items to shopping cart and the app remembers it next time you login. User can view all the items in their shopping cart. User can delete items in the shopping cart. Shopping cart uses an integer column to store "state".

  4. Checkout: User can fill in form and submit billing info. After submitting billing info, items in the shopping cart will move to a different "state".

@chrismdp
chrismdp / s3.sh
Last active January 23, 2025 09:26
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@martinrusev
martinrusev / cron_supervisord.ini
Last active March 18, 2025 07:21
Cron supervisord
[supervisord]
nodaemon=true
loglevel=debug
[program:amon]
command=gunicorn -c gunicorn.conf.py wsgi
directory=/amon
autostart=true
autorestart=true
redirect_stderr=true
@GMaissa
GMaissa / Jenkins-docker-wheezy-installer
Last active June 15, 2024 20:30
Installation script for Jenkins+Docker on Debian Wheezy
# Update wheezy kernel as it requires at least a kernel 3.11.x
echo "deb http://http.debian.net/debian wheezy-backports main" >> /etc/apt/sources.list
aptitude update
aptitude install -y -t wheezy-backports linux-image-amd64
mv /etc/grub.d/06_OVHkernel /root/
update-grub
reboot
# Install jenkins
echo "deb http://pkg.jenkins-ci.org/debian binary/" > /etc/apt/sources.list.d/jenkins.list
@pbock
pbock / buergerbot.rb
Last active December 26, 2024 10:59
Bürgerbot: Refreshes the Berlin Bürgeramt page until an appointment becomes available, then notifies you.
#!/usr/bin/env ruby
require 'watir-webdriver'
def log (message) puts " #{message}" end
def success (message) puts "+ #{message}" end
def fail (message) puts "- #{message}" end
def notify (message)
success message.upcase
system 'osascript -e \'Display notification "Bürgerbot" with title "%s"\'' % message
rescue StandardError => e
@yocontra
yocontra / LazyLoad.js
Created December 2, 2014 01:23
lazy loading react components, useful for video/audio/etc
var React = require('react');
var events = require('add-event-listener');
var isVisible = require('../isVisible');
var LazyLoad = React.createClass({
displayName: 'LazyLoad',
propTypes: {
distance: React.PropTypes.number,
component: React.PropTypes.node.isRequired,
children: React.PropTypes.node.isRequired
@stof
stof / ConditionalValidationGroup.php
Created September 10, 2014 12:03
Conditional validation group based on the state of the entity
<?php
namespace Incenteev\WebBundle\Validator;
use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"CLASS", "ANNOTATION"})
*/
@sahilsk
sahilsk / ELK Procedure
Created August 26, 2014 04:53
nginx proxy configuration for elasticsearch
## Install Docker
```
# install the backported kernel
$ sudo apt-get update
$ sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
$ sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
#!/bin/bash
#
# Automate mysql secure installation for debian-baed systems
#
# - You can set a password for root accounts.
# - You can remove root accounts that are accessible from outside the local host.
# - You can remove anonymous-user accounts.
# - You can remove the test database (which by default can be accessed by all users, even anonymous users),
# and privileges that permit anyone to access databases with names that start with test_.