Skip to content

Instantly share code, notes, and snippets.

StarWar /
Created October 8, 2021 09:34 — forked from tadast/
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
StarWar / firestore.rules
Created September 30, 2021 15:11 — forked from felipepastorelima/firestore.rules
Firestore Rules utilities to reduce verbosity. Generator:
service cloud.firestore {
match /databases/{database}/documents {
// START - Usage example
match /people/{document=**} {
function propertiesValid() {
return['name', 'birthdate', 'yearsOfExperience'])
&& == 3
&& isString('name') && minlength('name', 3) && maxlength('name', 255)
StarWar / Confirm.vue
Created April 10, 2020 07:14 — forked from eolant/Confirm.vue
Vuetify Confirm Dialog component that can be used locally or globally
<v-dialog v-model="dialog" :max-width="options.width" :style="{ zIndex: options.zIndex }" @keydown.esc="cancel">
<v-toolbar dark :color="options.color" dense flat>
<v-toolbar-title class="white--text">{{ title }}</v-toolbar-title>
<v-card-text v-show="!!message" class="pa-4">{{ message }}</v-card-text>
<v-card-actions class="pt-0">
<v-btn color="primary darken-1" text @click.native="agree">Yes</v-btn>
StarWar / media-query.css
Created April 7, 2019 06:08 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
##Device = Desktops
##Screen = 1281px to higher resolution desktops
@media (min-width: 1281px) {
StarWar / environment.js
Created December 25, 2018 14:28 — forked from nerdcave/environment.js
PurgeCSS config for Rails 5 and Webpacker (along with Tailwind CSS and Vue.js, in this case)
// first run:
// yarn add glob-all purgecss-webpack-plugin --dev
PurgeCSS configuration for Rails 5 + Webpacker + Tailwind CSS + Vue.js
Optionally, put this in production.js if you only want this to apply to production.
For example, your app is large and you want to optimize dev compilation speed.
StarWar / fibonacci.ex
Created October 29, 2018 12:36 — forked from dhc02/fibonacci.ex
Fibonacci sequence in Elixir
defmodule Fibonacci do
def find(nth) do
list = [1, 1]
fib(list, nth)
def fib(list, 2) do
StarWar /
Created August 31, 2018 15:36 — forked from jboesch/
Importing a CSV dump of Postgres data into Heroku
# You have your csv data and it looks like so... It's in a file named "my_data.csv" and we want to import it into a table named "my_things".
"1", "Something", "0.50", "2013-05-05 10:00:00"
"2", "Another thing", "1.50", "2013-06-05 10:30:00"
# Now you want to import it, go to the command line and type:
$ PGPASSWORD=PWHERE psql -h HOSTHERE -U USERHERE DBNAMEHERE -c "\copy my_things FROM 'my_data.csv' WITH CSV;"
# Voila! It's impoted. Now if you want to wipe it out and import a fresh one, you would do this:
StarWar / cookie-consent.html
Created July 3, 2018 18:07
Cookie Consent
StarWar / get-first-image.php
Created March 14, 2018 14:52 — forked from tommaitland/get-first-image.php
WordPress helper function that retrieves the first image from a post, with basic support for swapping the image size.
Based on the original CSS-Tricks code (
## Usage
Include in functions.php
<?php echo get_first_image('thumbnail'); ?>
StarWar /
Created January 3, 2018 15:32 — forked from tzmartin/
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')[OFFICE_FILE_URL]

<iframe src='[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>

OneDrive Embed Links