Skip to content

Instantly share code, notes, and snippets.

View jartaud's full-sized avatar

Josué Artaud jartaud

View GitHub Profile
@adhipg
adhipg / countries.sql
Created January 12, 2012 11:41
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@tarex
tarex / snippets.php
Created August 24, 2012 16:51
laravel authentication , remember me
<?php
// if you need the strtolower or some other data tweaks.
// remember me
$remember = Input::get('remember');
$credentials = array(
'username' => strtolower(Input::get('email')­),
'password' => Input::get('password'),
@tomhodgins
tomhodgins / html-tooltips.html
Last active May 30, 2020 23:27
HTML inside Bootstrap tooltips
<!DOCTYPE html>
<html>
<head>
<title>Tooltip HTML Styles</title>
<!-- Bootstrap: with responsive, no icons -->
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<!-- FontAwesome -->
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css" rel="stylesheet">
@jamesejr
jamesejr / sublime-settings
Last active May 15, 2019 06:16
Personal customized Sublime Text 3 configuration file with Inconsolata font
{
"bold_folder_labels": true,
"caret_extra_width": 1,
"caret_style": "phase",
"close_windows_when_empty": false,
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"draw_minimap_border": true,
"enable_tab_scrolling": false,
"font_face": "Inconsolata",
"font_options":
@Mulkave
Mulkave / php-built-in-server-runners.php
Last active March 20, 2021 05:31
This is a way to leverage the PHP built-in web server in your tests. Uses the new @beforeClass and @afterclass annotation introduced in phpunit v3.8.x.
<?php
Class MyTest extends PHPUnit_Framework_TestCase {
static $pidfile = './.pidfile';
static $serverHost = 'localhost';
static $serverPort = '6767';
public static function serverURL()
{
@kendellfab
kendellfab / goto-sublime
Created August 1, 2013 20:53
Add mouse click `goto definition` in sublime text 3.
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User
[
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl"],
"press_command": "drag_select",
@driesvints
driesvints / laravel-weekly-24-quick-tip.php
Created September 24, 2013 08:22
Laravel Weekly #24 - Quick Tip
<?php
// Redirect to a named 'home' route.
return Redirect::home();
// Refresh the current URI.
return Redirect::refresh();
@driesvints
driesvints / laravel-weekly-25-quick-tip.php
Last active March 28, 2019 13:52
Laravel Weekly #25 Quick Tip
<?php
// Get an array of all files in a directory.
$files = File::files('path_to_dir');
// Get all of the files from the given directory (recursive).
$files = File::allFiles('path_to_dir');
// Get all of the directories within a given directory.
$files = File::directory('path_to_dir');
@Meroje
Meroje / comment.php
Created December 4, 2013 07:43
TimeDiff For Humans
<?php
use Carbon\Carbon;
class Comment extends Eloquent {
protected $guarded = array();
protected $softDelete = true;
public static $rules = array();
@isimmons
isimmons / gist:8202227
Last active March 15, 2024 10:47
Truncate tables with foreign key constraints in a Laravel seed file.

For the scenario, imagine posts has a foreign key user_id referencing users.id

public function up()
{
	Schema::create('posts', function(Blueprint $table) {
		$table->increments('id');
		$table->string('title');
		$table->text('body');