Skip to content

Instantly share code, notes, and snippets.

@ursuleacv
ursuleacv / index.html
Created November 20, 2012 20:15
A CodePen by ursuleacv. Unmask Password On Focus - Not compatible in IE, will post a fix soon.
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
</head>
<body>
<div>
<h1>Passwords<span> unmask on focus</span></h1>
<form>
<input type="password" value="" class="password" placeholder="Enter Password" id="password" />
<input type="password" value="" class="password" placeholder="Confirm Password" id="confirm" />
@ursuleacv
ursuleacv / index.html
Created November 20, 2012 20:17
A CodePen by Adem ilter. Countdown Clock
<div class="container">
<ul class="flip minutePlay">
<li>
<a href="#">
<div class="up">
<div class="shadow"></div>
<div class="inn">0</div>
</div>
<div class="down">
@ursuleacv
ursuleacv / index.html
Created November 20, 2012 20:19
A CodePen by mutukrish. earth and moon animation using css3
<div id="moon_holder">
<div id="moon_back"></div>
<img src="http://lab.legomushroom.com/___img/moon2.png" id="moon">
<div id="moon_ball"></div>
</div>
<div id="center" align="center">
<div id="earth_holder">
<div id="earth_ball"></div>
<div id="earth_glow"></div>

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

Composer Related

@ursuleacv
ursuleacv / gist:5835023
Created June 21, 2013 23:16
Node js Prime function
prime = function (val) {
if (val === 1) return false;
else if (val === 2) return true;
else if (val !== undefined) {
var start = 1;
var valSqrt = Math.ceil(Math.sqrt(val));
while (++start <= valSqrt) {
if (val % start === 0) {
return false;
}
@ursuleacv
ursuleacv / gist:6023125
Created July 17, 2013 18:27
How to let PHP to create subdomain automatically for each user?
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^([aA-zZ])$ dostuff.php?username=$1
The rewrite rule for grabbing the subdomain would look like this:
RewriteCond %{HTTP_HOST} ^(^.*)\.mywebsite.com
RewriteRule (.*) dostuff.php?username=%1
@ursuleacv
ursuleacv / gist:6032463
Created July 18, 2013 19:50
htaccess file for Laravel for redirecting to public folder
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ /public/$1 [L]
@ursuleacv
ursuleacv / gist:6074034
Created July 24, 2013 20:05
How do I make a simple crawler in PHP?
<?php
function crawl_page($url, $depth = 5)
{
static $seen = array();
if (isset($seen[$url]) || $depth === 0) {
return;
}
$seen[$url] = true;
@ursuleacv
ursuleacv / gist:6093304
Last active December 20, 2015 07:29
PHP & MySQL best way to count page views for dynamic pages
INSERT INTO sites_views ( site_id, views) VALUES ( $site_id, 1)
ON DUPLICATE KEY UPDATE views=views+1
@ursuleacv
ursuleacv / gist:6142485
Created August 2, 2013 19:05
Changing the default rsa key in Git bash for heroku
If you're using msysgit with the OpenSSH tools, you need to either create ~/.ssh/id_rsa, or create a git config in ~/.ssh/config which points to your key.
Here's an example of a Git config for bitbucket that will use the correct username, and a key other than the default key (in case you maintain one key for SSH connections, and another for git accounts).
Host heroku.com
Hostname heroku.com
IdentityFile /C/keys/yourkey.key
Once in git bash, you can run two commands to add your key to your current session's ssh-agent to avoid having to repeatedly type the key's password.
eval `ssh-agent`