This file contains hidden or 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
Format: ssh -i <path-to-private-key> <link-local-ip> -p 3922 | |
Example: root@faith:~# ssh -i /root/.ssh/id_rsa.cloud 169.254.3.93 -p 3922 |
This file contains hidden or 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
<select id="country" name="country" class="full-width" selected="" data-init-plugin="select2"> | |
<option value="AF">Afghanistan</option> | |
<option value="AX">Åland Islands</option> | |
<option value="AL">Albania</option> | |
<option value="DZ">Algeria</option> | |
<option value="AS">American Samoa</option> | |
<option value="AD">Andorra</option> | |
<option value="AO">Angola</option> | |
<option value="AI">Anguilla</option> | |
<option value="AQ">Antarctica</option> |
This file contains hidden or 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
#AND | |
<b:if cond='data:blog.pageType == "index"'> | |
<b:if cond='data:blog.searchQuery'> | |
<!--search_page AND index_page--> | |
</b:if> | |
</b:if> | |
#OR |
This file contains hidden or 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
/* | |
* Author: http://stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/ | |
*/ | |
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Styles */ | |
} |
This file contains hidden or 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
Button btnFacebook = findViewById(R.id.btn_facebook); | |
Drawable leftDrawable = AppCompatResources.getDrawable(this, R.drawable.baseline_power_settings_new_black_18dp); | |
btnFacebook.setCompoundDrawablesWithIntrinsicBounds(leftDrawable, null, null, null); | |
// Start Facebook integration | |
LoginManager fbLoginManager = com.facebook.login.LoginManager.getInstance(); | |
mCallbackManager = CallbackManager.Factory.create(); | |
fbLoginManager.registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { | |
@Override |
This file contains hidden or 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
# Useful to prevent Macbooks to go to sleep when closing the lid instead of running tools that requires a Kernel Extension (e.g. InsomniaX) and more | |
# Before doing anything, save your current configuration using | |
pmset -g | |
# To disable sleep | |
sudo pmset -a sleep 0; sudo pmset -a hibernatemode 0; sudo pmset -a disablesleep 1; | |
# And to go back to normal | |
sudo pmset -a sleep 1; sudo pmset -a hibernatemode [original hibernatemode value]; sudo pmset -a disablesleep 0; |
This file contains hidden or 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
@Entity() | |
export class User { | |
@PrimaryGeneratedColumn("uuid") | |
id: string; | |
} |
This file contains hidden or 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 { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; | |
import { Document } from 'mongoose'; | |
import { v4 as uuidv4 } from 'uuid'; | |
@Schema() | |
export class Course extends Document { | |
@Prop({ type: String, default: function genUUID() { | |
return uuidv4() | |
}}) |
This file contains hidden or 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
healthcheck: | |
test: echo $$(wget --server-response http://node1:8222/varz 2>&1 | grep '200 OK') | grep '200' || exit 1 | |
interval: 20s | |
timeout: 5s | |
retries: 5 | |
start_period: 40s |
This file contains hidden or 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
# disable sleep | |
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1 | |
# re-enable sleep | |
sudo pmset -b sleep 5; sudo pmset -b disablesleep 0 |