Skip to content

Instantly share code, notes, and snippets.

View halilim's full-sized avatar

Halil Özgür halilim

View GitHub Profile
@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 / zsh-debug-startup.sh
Created August 21, 2014 14:13
List zsh startup scripts line by line verbosely
zsh -x 2>&1
@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) {
@halilim
halilim / homebrew_postgres_recreate.sh
Created November 16, 2014 12:48
PostgreSQL recreate sequence craze - Homebrew Postgres, Y U NO collate tr_TR ?!
gem install lunchy
pg_dumpall > pg_all.sql
# Kill anything that access PostgreSQL before this, e.g. local rails server, pgAdmin etc
sudo lunchy stop homebrew.mxcl.postgresql
mv /usr/local/var/postgres{,.bak}
LC_CTYPE="tr_TR.UTF-8" initdb -E UTF-8 --locale=tr_TR --lc-collate=tr_TR --lc-ctype=tr_TR -D /usr/local/var/postgres/
sudo lunchy start homebrew.mxcl.postgresql
psql -f pg_all.sql -d postgres
# Make sure pg_all.sql is safe and can be restored before this
rm -rf /usr/local/var/postgres.bak
@halilim
halilim / Server Security and Performance - Base OS.md
Last active July 20, 2018 20:04
Server Security / Performance - Base OS
Notes
Preliminary packages
  • Development packages, you'll most probably need them
    • Ubuntu: sudo apt-get install build-essential
    • CentOS: yum groupinstall 'Development Tools'
  • Git