Skip to content

Instantly share code, notes, and snippets.

View dlucian's full-sized avatar
💭
🦇

Lucian Daniliuc dlucian

💭
🦇
View GitHub Profile
<?
// This code works with an optional $country_code variable that preselects a country
$countries = array(
'AF'=>'Afghanistan',
'AL'=>'Albania',
'DZ'=>'Algeria',
'AS'=>'American Samoa',
'AD'=>'Andorra',
'AO'=>'Angola',
'AI'=>'Anguilla',
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>HTML5 Quicktest Form!</title>
<!--<link rel="stylesheet" href="css/main.css" type="text/css" />-->
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<!--[if lte IE 7]>
@dlucian
dlucian / macbook.md
Last active April 20, 2016 14:20
MacBook / OS-X Configs

Sublime (User) settings:

{
	"draw_white_space": "selection",
	"tab_size": 4,
    "translate_tabs_to_spaces": true,
    "open_files_in_new_window": false
}
@dlucian
dlucian / do_not_log.conf
Created June 30, 2016 11:53 — forked from kfl62/do_not_log.conf
nginx configuration file, (do not log robots.txt and favicon.ico requests)
# Designed to be included in any server {} block.
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
@dlucian
dlucian / Timezone-Select-Template.html
Created June 10, 2013 20:32
Timezone generated HTML output by the Timezone PHP Generator: https://github.com/dlucian/Timezone-Generator-PHP
<select name="timezone" id="timezone">
<optgroup label="UTC -11:00">
<option value="Pacific/Midway">UTC -11:00 Midway</option>
<option value="Pacific/Niue">UTC -11:00 Niue</option>
<option value="Pacific/Pago_Pago">UTC -11:00 Pago_Pago</option>
</optgroup>
<optgroup label="UTC -10:00">
<option value="America/Adak">UTC -10:00 Adak</option>
<option value="Pacific/Honolulu">UTC -10:00 Honolulu</option>
<option value="Pacific/Johnston">UTC -10:00 Johnston</option>

Searching

Search files with a certain extension for a specific string

find . -name "*.php" -exec grep -H "217.156.XXX.XXX" {} \;

Search files older than X days and delete them

find /var/log/.../*.log -mtime +3 -exec rm {} \;

Searching in files over several lines

@dlucian
dlucian / git-tricks.md
Last active November 21, 2017 12:58
Git Magic Tricks

Useful git operations in a developer's daily work

Undo all changes since last commit

Source

git reset HEAD --hard
git clean -fd
@dlucian
dlucian / MACOS-DEV.md
Last active February 25, 2018 14:29
MacOS Development Setup

Install MacOS

Updgrade to High Sierra if needed.

Remove unused items in the Dock, then move the Dock to the left and make it autohide.

Make sure iCloud Drive is configured as it will take a while to sync information.

Install Basic Tools & Applications

@dlucian
dlucian / GPG-GitHub-Desktop.md
Created May 23, 2018 05:59
Setup GPG with GitHub Desktop

Via Daniel Müller:

On Mac OS X you could do:

echo no-tty >> ~/.gnupg/gpg.conf
git config --global gpg.program $(which gpg)
git config --global commit.gpgsign true