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
#!bin/bash | |
DOCKER_PIDS=$(docker ps -a -q) | |
if [ -n "$DOCKER_PIDS" ]; then | |
docker stop $DOCKER_PIDS && docker rm $DOCKER_PIDS | |
fi |
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
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |
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
<template> | |
<v-dialog v-model="dialog" :max-width="options.width" :style="{ zIndex: options.zIndex }" @keydown.esc="cancel"> | |
<v-card> | |
<v-toolbar dark :color="options.color" dense flat> | |
<v-toolbar-title class="white--text">{{ title }}</v-toolbar-title> | |
</v-toolbar> | |
<v-card-text v-show="!!message" class="pa-4">{{ message }}</v-card-text> | |
<v-card-actions class="pt-0"> | |
<v-spacer></v-spacer> | |
<v-btn color="primary darken-1" text @click.native="agree">Yes</v-btn> |
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
<template> | |
<div> | |
<!-- Using hide-overlay below allows for clicking while progress showing--> | |
<v-dialog | |
v-model="dialog" | |
persistent | |
:width="options.width" | |
v-bind:style="{ zIndex: options.zIndex }" | |
> | |
<v-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
const echoPostRequest = { | |
url: pm.environment.get('api_url'), | |
method: 'POST', | |
header: 'Content-Type:application/json', | |
body: { | |
mode: 'application/json', | |
raw: JSON.stringify( | |
{ | |
client_id:pm.environment.get('client_id'), | |
client_secret:pm.environment.get('client_secret'), |
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 HousePickerView extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new GradientAppBar('Houses', | |
new ListView( | |
children: <Widget>[ | |
new HouseListTile(url: [ | |
'https://statusandphoto.weebly.com/uploads/6/0/1/5/60158603/8347592_orig.png', | |
'http://globalmedicalco.com/photos/globalmedicalco/20/98181.jpg', | |
'https://allinonetricks.com/wp-content/uploads/2017/08/5-7.png' |
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
static String timeAgoSinceDate(String dateString, {bool numericDates = true}) { | |
DateTime date = DateTime.parse(dateString); | |
final date2 = DateTime.now(); | |
final difference = date2.difference(date); | |
if ((difference.inDays / 365).floor() >= 2) { | |
return '${(difference.inDays / 365).floor()} years ago'; | |
} else if ((difference.inDays / 365).floor() >= 1) { | |
return (numericDates) ? '1 year ago' : 'Last year'; | |
} else if ((difference.inDays / 30).floor() >= 2) { |
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 | |
# Reference: https://github.com/nagygergo/jetbrains-toolbox-install/blob/master/jetbrains-toolbox.sh | |
# Note that we grep for linux here, if you are using this on mac/windows please see json output | |
TOOLBOX_URL=$(curl --silent 'https://data.services.jetbrains.com//products/releases?code=TBA&latest=true&type=release' \ | |
-H 'Origin: https://www.jetbrains.com' \ | |
-H 'Accept-Encoding: gzip, deflate, br' \ | |
-H 'Accept-Language: en-US,en;q=0.8' \ | |
-H 'Accept: application/json, text/javascript, */*; q=0.01' \ | |
-H 'Referer: https://www.jetbrains.com/toolbox/download/' \ |
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
server { | |
server_name default_server; | |
# This is for Let's Encrypt certification renewal | |
include /etc/nginx/snippets/letsencrypt.conf; | |
# Redirect to https | |
location / { | |
return 301 https://$server_name$request_uri; | |
} | |
} |
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
// ==UserScript== | |
// @name Vortek Preload | |
// @namespace vortek | |
// @description Load variables | |
// @include http://localhost/vortek_php/* | |
// @version 1 | |
// ==/UserScript== | |
// a function that loads jQuery and calls a callback function when jQuery has finished loading | |
function addJQuery(callback) { | |
var script = document.createElement("script"); |
OlderNewer