Skip to content

Instantly share code, notes, and snippets.

View halilim's full-sized avatar

Halil Özgür halilim

View GitHub Profile
@halilim
halilim / find_non_public_files.sh
Created February 12, 2014 08:18
Find non-public files (e.g. ini, yaml, log etc) that shouldn't be public.
find . -type f \( ! -name "*.php" -and ! -name "*.css" -and ! -name "*.js" -and ! -name "*.jpg" -and ! -name "*.png" -and ! -name "*.gif" \) -not -path "*/vendor/*"
@halilim
halilim / PostgreSQL 9.3-latest on Ubuntu 12.04.md
Created April 2, 2014 15:30
Install PostgreSQL 9.3/latest on Ubuntu 12.04
sudo nano /etc/apt/sources.list.d/pgdg.list
# - Add
# deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main
# - and save
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.3 libpq-dev
sudo nano /etc/postgresql/9.3/main/pg_hba.conf
@halilim
halilim / Solr Field Manual.md
Last active August 29, 2015 13:59
Solr Field Manual

Solr Field Manual

This is a specific setup for use with periodic MySQL import, but can be used as a general solution by excluding the irrelevant parts.

Legend

Code Description
<SOLR> E.g.: /var/lib/tomcat#/solr, /etc/solr, ...
<CORE> Core name
@halilim
halilim / git_pull_subdirs.sh
Created June 17, 2014 19:57
Git pull subdirectories
for dir in ./*; do (echo "- $dir" && cd "$dir" && git pull); done
@halilim
halilim / Copy_districts.sql
Last active August 29, 2015 14:03
Copy districts from one db to another with differing province id's.
INSERT districts
SELECT
NULL
, district_other.name
, district_other.province_other_id
, IFNULL(province_other.name, '')
FROM other_db.district_other
LEFT JOIN other_db.province_other ON province_other.id = district_other.province_other_id
;

Security

  • If you don't have a really loaded CPU/harddisk (or have a good performance CPU/harddisk - in practice anything with an i5/i7 CPU should be OK) you should use full disk encryption - FileVault 2 if you have anything in your computer that needs security/privacy.

Hardware/drivers etc

(["Developers"]*3).join(", ")

@halilim
halilim / On the names.md
Last active August 29, 2015 14:05
Should we store names in a single field or in multiple fields (e.g. first/last name-wrong naming BTW)?
@halilim
halilim / jsist-easter.js
Created August 27, 2014 08:00
jsist easter
var container = document.getElementById('answer');
for(var i = 1; i <= 5; i++) {
(function(i) {
var a = document.createElement("a");
a.innerHTML = "link" + i + " ";
var onClick = function () {
alert(i);
};
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Test</title>
<link>http://example.com</link>
<description>Just a RSS test</description>
<item>
<title>A title with some &ccedil;&apos;s and &uuml;&apos;s</title>
<link>http://example.com/test</link>
<description>Item description</description>
@halilim
halilim / jquery.easyHide.js
Last active August 29, 2015 14:08
jQuery easyHide plugin - a simple plugin to hide stuff by clicking anywhere on the document (other than the element) or by hitting ESC.
;(function ($) {
$.fn.easyHide = function (opts) {
opts = opts || {};
opts["hideFn"] = opts["hideFn"] || function () {
this.hide();
};
return this.each(function () {
var $this = $(this);
if (opts["onDocClick"] !== false) {