Skip to content

Instantly share code, notes, and snippets.

View microdesign's full-sized avatar
💭
Working hard

Martin Tonev microdesign

💭
Working hard
View GitHub Profile
function dq($query){
$sql = $query->toSql();
foreach($query->getBindings() as $key => $binding){
$sql = preg_replace('/\?/', "'$binding'", $sql, 1);
}
dd($sql);
}
git archive --output=test_zip.zip HEAD $(git diff --name-only HASH1 HASH2)
anonymous
anonymous / index.html
Created October 1, 2015 19:49
JS Bin // source http://jsbin.com/qozosiluju
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<style>
@microdesign
microdesign / jQueryDroppable.js
Last active September 18, 2015 12:40 — forked from seanmcn/jQueryDroppable.js
jQuery Droppable (Accept only one Draggable)
$(".drop_area").droppable({
tolerance: "intersect",
accept: ".drop_item",
greedy: true,
drop : function(event, ui) {
$(this).droppable( "option", "disabled", true );
},
out : function(event, ui) {
$(this).droppable( "option", "disabled", false );
},
@microdesign
microdesign / gist:e1b8d74806fdb2f1a4c1
Last active November 12, 2015 08:46
Draw text to existing image and save it into new one - PHP
$ts = gmdate("D, d M Y H:i:s") . " GMT";
header("Expires: $ts");
header("Last-Modified: $ts");
header("Pragma: no-cache");
header("Cache-Control: no-cache, must-revalidate");
$imgPath = \URL::to( 'exiting_images/exiting.jpg' );
$save_image = 'user_images/test.jpg';
$save_to = public_path($save_image);
@jatubio
jatubio / web.config
Created April 29, 2015 03:49
IIS web.config file for Laravel 5
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<!-- Quitar los slash '/' del final de la ruta -->
<rule name="RewriteRequestsToPublic">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
</conditions>
@Webcreations907
Webcreations907 / example.php
Last active June 8, 2022 13:19
Example VC Nesting
<?php
/************************************************************************
* Example Nested For VC
* vc_map() stuff should only be included when VC is enabled.
*
* This is just for a copy/paste test purpose.
*************************************************************************/
@irazasyed
irazasyed / Install Composer using MAMP's PHP.md
Last active April 2, 2024 18:45
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@keithmorris
keithmorris / remove-words.php
Created November 27, 2012 16:22
PHP remove common words from a string
<?php
function removeCommonWords($input){
// EEEEEEK Stop words
$commonWords = array('a','able','about','above','abroad','according','accordingly','across','actually','adj','after','afterwards','again','against','ago','ahead','ain\'t','all','allow','allows','almost','alone','along','alongside','already','also','although','always','am','amid','amidst','among','amongst','an','and','another','any','anybody','anyhow','anyone','anything','anyway','anyways','anywhere','apart','appear','appreciate','appropriate','are','aren\'t','around','as','a\'s','aside','ask','asking','associated','at','available','away','awfully','b','back','backward','backwards','be','became','because','become','becomes','becoming','been','before','beforehand','begin','behind','being','believe','below','beside','besides','best','better','between','beyond','both','brief','but','by','c','came','can','cannot','cant','can\'t','caption','cause','causes','certain','certainly','changes','clearly','c\'mon','co','co.','com','come','comes','concerni