Skip to content

Instantly share code, notes, and snippets.

View marjinal1st's full-sized avatar
🥃
Master of Ballmer Peak

Ahmet Sezgin DURAN marjinal1st

🥃
Master of Ballmer Peak
View GitHub Profile
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import pygame
from pygame.locals import *
import sys
from sprite_anim import *
pygame.init()
@marjinal1st
marjinal1st / gist:8c4c700c84ae33185b96
Created December 14, 2014 17:52
python-sfml build error 2
marjinal1st@thinkpad-edge:~/Python/python-sfml$ python setup.py install
running install
running build
running build_py
copying src/sfml/__init__.py -> build/lib.linux-x86_64-2.7/sfml
copying src/sfml/sf.py -> build/lib.linux-x86_64-2.7/sfml
running build_ext
cythoning src/sfml/system.pyx to src/sfml/system.cpp
building 'sfml.system' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Iinclude -I/usr/include/python2.7 -c src/sfml/system.cpp -o build/temp.linux-x86_64-2.7/src/sfml/system.o -fpermissive
@marjinal1st
marjinal1st / gist:03f9e6daeaeb3f2aafc7
Created December 14, 2014 17:30
python-sfml build error
(venv)marjinal1st@thinkpad-edge:~/Python/python-sfml$ python setup.py install
running install
running build
running build_py
running build_ext
cythoning src/sfml/system.pyx to src/sfml/system.cpp
Error compiling Cython file:
------------------------------------------------------------
...
@marjinal1st
marjinal1st / gist:db948f4f247fd0a29b65
Created November 19, 2014 20:29
updated builder script
#!/bin/bash
## Exit trap
trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
set -e
## Fancy echo
fancy_echo() {
printf "\n%b\n" "$1"
@marjinal1st
marjinal1st / peakdet.m
Last active August 29, 2015 14:07 — forked from endolith/peakdet.m
function [maxtab, mintab]=peakdet(v, delta, x)
%PEAKDET Detect peaks in a vector
% [MAXTAB, MINTAB] = PEAKDET(V, DELTA) finds the local
% maxima and minima ("peaks") in the vector V.
% MAXTAB and MINTAB consists of two columns. Column 1
% contains indices in V, and column 2 the found values.
%
% With [MAXTAB, MINTAB] = PEAKDET(V, DELTA, X) the indices
% in MAXTAB and MINTAB are replaced with the corresponding
% X-values.
import pygame
from time import sleep
pygame.init()
pygame.mixer.init()
test = pygame.mixer.Sound("test.wav")
while True:
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="amuse"
# Example aliases
require 'luhn'
require 'json'
require 'uri'
require 'net/http'
notes = ["Note: spaces and dashes aren't allowed. If you are going to write\n",
"4444 4444 4444 4448 or 4444-4444-4444-4448, write:\n",
"4444444444444448.\n",
"Note 2:If your Diners Club card begins with 5 and is 16 digits,\n",
'it will be treated as a Mastercard.'

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
Add .editorconfig file
create .editorconfig
Add .ruby-version file
create .ruby-version
Add disable_xml_params.rb file to initilizers
create config/initializers/disable_xml_params.rb
Add paperclip.rb file to initilizers
create config/initializers/paperclip.rb
Setting up database
force config/database.yml