This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyModel extends Eloquent { | |
protected $attributes = array( | |
'field' => 'default', | |
'field2' => 'default2', | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseController extends Controller | |
{ | |
public function __construct() | |
{ | |
// Fetch the User object, or set it to false if not logged in | |
if (Sentry::check()) { | |
$user = User::find(Sentry::getUser()–>id); | |
} | |
else { | |
$user = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<style> | |
.flex | |
{ | |
/* basic styling */ | |
width: 350px; | |
height: 200px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static com.googlecode.javacv.cpp.opencv_core.*; | |
import static com.googlecode.javacv.cpp.opencv_highgui.*; | |
import static com.googlecode.javacv.cpp.opencv_imgproc.*; | |
public class circleDetection{ | |
public static void main(String[] args){ | |
IplImage src = cvLoadImage("img2.png"); | |
IplImage gray = cvCreateImage(cvGetSize(src), 8, 1); | |
cvCvtColor(src, gray, CV_BGR2GRAY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Form::file('file[]', array('multiple'=>true)); | |
//or: | |
<input multiple="1" name="file[]" type="file"> | |
//Or for older browsers: | |
<input name="file[]" type="file"> | |
<input name="file[]" type="file"> | |
<input name="file[]" type="file"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Illuminate\Routing\UrlGenerator | |
__construct(RouteCollection $routes, Request $request) Both parameter ar from Symfony | |
full() // Get the full URL for the current request. | |
current() // Get the current URL for the request. | |
previous() // Get the URL for the previous request. | |
to($path, $parameters = array(), $secure = null) // Generate a absolute URL to the given path. | |
secure($path, $parameters = array()) // Generate a secure, absolute URL to the given path. | |
asset($path, $secure = null) // Generate a URL to an application asset. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
class AsyncOperation extends Thread { | |
public function __construct($arg) { | |
$this->arg = $arg; | |
} | |
public function run() { | |
if ($this->arg) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X POST -H "Content-Type:application/json" -d '{"target":"http://youruser:yourpassword@yourserver/tangerine","source":"http://youruser:yourpassword@yourserver/tangerine","doc_ids": ["_design/tangerine"]}' http://youruser:yourpassword@yourserver/_replicate |
OlderNewer