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 / railsterminal.sh
Last active January 1, 2016 05:09
Gnome Terminals for Rails 3.2 and 4 - Modified from http://snipplr.com/view.php?codeview&id=32227
#!/bin/bash
# Rails Terminals for Rails 3.2/4 and Gnome
# A simple script that opens a Gnome terminal with titled tabs:
# 1. Rails Server
# 2. Spork
# 3. bash
# and opens the app in:
# 1. Sublime Text
# 2. Browser
@halilim
halilim / Testing & quality assurance - tools and the list of the things to test.md
Last active May 13, 2017 18:49
Testing & Q&A - tools and the list of the things to test

A list of things that can/should be tested, preferably before commit/receive.

General

Tools

@halilim
halilim / Ubuntu 13.10 Install (Windows Dual Boot).md
Last active March 18, 2017 16:57
Ubuntu 13.10 Install (Windows Dual Boot) - Some issues and how-to for installing

Notes

  • Replace “halil” with your username.
  • Work in progress.

GPU/Graphics Driver

Nvidia

@halilim
halilim / simple git deploy
Created November 29, 2013 12:02
A very simple git deploy method. `git init` anywhere (e.g. /home/user/src) and add this to `.git/hooks/post-receive`. Now when you do `git push production master` (assuming the remote for server is "production"), your project will be deployed. Replace `/home/user/public_html` with the working directory (e.g. the web/project root). Files tracked …
GIT_WORK_TREE=/home/user/public_html git checkout -f
@halilim
halilim / Link_solr_conf.sh
Last active December 26, 2015 05:29
Symlinks data-config.xml, schema.xml and solrconfig.xml, copies db-connection.xml. This is for projects where Solr configs reside inside the main repo and the db parameters are specified using an external file.
@halilim
halilim / Array_insert.php
Last active December 22, 2015 23:39
A PHP function that can insert at both integer and string positions
<?php
/**
* A function that can insert at both integer and string positions
*
* @param array $array
* @param int|string $position
* @param mixed $insert
*/
function array_insert(&$array, $position, $insert)
@halilim
halilim / truecrypt_skype.bat
Created September 3, 2013 15:59
Helps securing Skype profile by storing it in a TrueCrypt drive
@echo off
REM Helps securing Skype profile by storing it in a TrueCrypt drive
REM 1. Create the container if you don't have it
REM 2. Disable auto starting of Skype on Windows Start
REM 3. Log out and completely exit Skype
REM 4. Move %APPDATA%\Skype into the container, e.g. K:\AppData\Skype
REM 5. mklink /D "%APPDATA%\Skype" "K:\AppData\Skype"
REM 6. Add a shortcut like `C:\Code\truecrypt_skype.bat D:\test\example.tc`
REM to "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup"
@halilim
halilim / delete_iconcache.bat
Created September 3, 2013 15:11
Purge (Delete) Windows icon cache
taskkill /F /IM explorer.exe
cd /d %userprofile%\AppData\Local
attrib –h IconCache.db
del IconCache.db
start explorer
@halilim
halilim / gzipper.php
Created September 1, 2013 19:09
GZip a File
<?php
if (!empty($_POST) && isset($_FILES['file'])
&& $_FILES['file']['error'] == UPLOAD_ERR_OK
) {
header(
'Content-Disposition: attachment; filename="'
. $_FILES['file']['name'] . '.gz";'
);
echo gzencode(file_get_contents($_FILES['file']['tmp_name']));
exit;