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
## Migration | |
# Create a migration to create a table named 'posts' | |
php artisan generate:migration create_posts_table | |
# Create a migration to add a field named 'user_id' to the 'posts' table | |
php artisan generate:migration add_user_id_to_posts_table | |
# Create a migration to remove the 'user_id' field we just created | |
php artisan generate:reomve_user_id_from_posts_table |
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 Deck { | |
List<Card> cards = []; | |
Deck() { | |
var ranks = ['Ace', 'Two', 'Three', 'Four']; | |
var suits = ['Diamonds', 'Hearts', 'Clubs', 'Spades']; | |
for (var suit in suits) { | |
for (var rank in ranks) { | |
var card = Card(rank: rank, suit: suit); | |
this.cards.add(card); |
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
# initialization file (not found) |
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 | |
GITHUB_USERNAME=<username> | |
GITHUB_ACCESS_TOKEN=<access-token> | |
REPO_URL=https://api.github.com/repos/<repo-owner>/<repo> | |
PR_BASE_URL=${REPO_URL}/pulls | |
COMMENT_BASE_URL=${REPO_URL}/issues |
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
# Display current date and time (including timezone) | |
date | |
# Change timezone | |
sudo dpkg-reconfig tzdata | |
# or | |
sudo dpkg-reconfigure tzdata | |
# restart cron as otherwise the time will keep running on UTC | |
/etc/init.d/cron stop |
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
### Keybase proof | |
I hereby claim: | |
* I am robinmitra on github. | |
* I am robinmitra (https://keybase.io/robinmitra) on keybase. | |
* I have a public key ASCodCcll-pjzpklJKdlVMWRqYuG2yHNA7yLtZmAP-ETVwo | |
To claim this, I am signing this object: |
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
############ | |
# Packages # | |
############ | |
brew install tree | |
brew install nvm | |
brew install fzf | |
brew install highlight | |
######### |
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
# Syntax | |
history <start> <end> | |
# Show all items in history | |
history 1 |
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
# Show ten most used commands from history | |
history-stat |
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 | |
class Singleton | |
{ | |
/** | |
* @var self Single instance | |
*/ | |
private static $instance = null; | |
/** |
NewerOlder