🧘♂️
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/env bash | |
echo "--- Hello, master. Let's get to work. Installing now. ---" | |
echo "--- Updating packages list ---" | |
sudo apt-get update | |
echo "--- MySQL time ---" | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root' | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root' |
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
<option value="1">1</option> | |
<option value="2">2</option> | |
<option value="3">3</option> | |
<option value="4">4</option> | |
<option value="5">5</option> | |
var select = document.getElementById("demo"); | |
var i=0; | |
for(i=1;i<=5;i++){ |
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
<!-- First Create a Template to append --> | |
<script type="text/plain" id="row_template" > | |
<tr> | |
<td><input type="text" Placeholder="Simple" data-property="first_simple"></td> | |
<td><input type="text" Placeholder="Simple" data-property="second_simple"></td> | |
<td><input type="text" Placeholder="Simple" data-property="third_simple"></td> | |
</tr> | |
</script> | |
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
## [To get first and last day of the month in js](http://stackoverflow.com/questions/13571700/get-first-and-last-date-of-current-month-with-javascript-or-jquery) | |
var date = new Date(); | |
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1); | |
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0); | |
## For Month Select | |
function dateDropdown(select) { |
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
{{ ''; $your_variable_name = 'Your Variable Value'; }} |
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
//Deteact keyboard code when user type to the input | |
$('input').on('keydown', function (e) { | |
console.log(e.keyCode); | |
}) | |
//For esc/i/j and k | |
$(document).keyup(function(e) { | |
if (e.keyCode == 27) { alert('esc') } // esc | |
if (e.keyCode == 73) { alert('i') } // i insert mode | |
if (e.keyCode == 74) { alert('j') } // j left |
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
//Create New Folder Call MyClass on `app/` directory | |
Add new line on `/app/start/global.php` | |
ClassLoader::addDirectories(array( | |
app_path().'/commands', | |
app_path().'/controllers', | |
app_path().'/models', | |
app_path().'/database/seeds', | |
app_path().'/MyClass', // This line is the one we need to add |
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
function printout() { | |
var newWindow = window.open(); | |
newWindow.document.write(document.getElementById("out").innerHTML); | |
newWindow.print(); | |
} |
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
/** | |
* Create a new Elegant class | |
* And use that class from your model | |
*/ | |
class Elegant extends Eloquent | |
{ | |
protected $rules = array(); | |
protected $errors; |
OlderNewer