Skip to content

Instantly share code, notes, and snippets.

View r115's full-sized avatar
:octocat:
🇰🇪

Bernard r115

:octocat:
🇰🇪
View GitHub Profile
@litzinger
litzinger / index.js
Last active December 21, 2021 17:01
Simple Puppeteer screenshot script
/*
If saving AWS creds locally they need to be in ~/.aws/credentials
[default]
aws_access_key_id = foo
aws_secret_access_key = bar
*/
const puppeteer = require('puppeteer');
const AWS = require('aws-sdk');
@dleske
dleske / k8s-update-secret.md
Last active January 29, 2024 17:12
k8s: Updating a Secret

Hopefully helped another k8s newbie with the following. The question was, how do you update a single key in a secret in k8s? I don't know anything about secrets but I will probably want to know this in the future, so here we go.

First, to create a dummy secret:

apiVersion: v1
kind: Secret
metadata:
  name: test-secret
data:
@brianneisler
brianneisler / cheat-sheet.js
Last active November 27, 2022 08:23
Cheat sheet - es6 import/export mixed with require/modules.exports
require('./module.js') // { a: 1 }
import module from './module.js' // undefined
import { a } from './module.js' // 1
require('./module2.js') // { default: { a: 1 }, b: 2 }
import module2 from './module2.js' // { a: 1}
import { b } from './module2.js' // 2
require('./module3.js') // { default: { a: 1 }, b: 2 }
@RTLer
RTLer / app.js
Last active March 25, 2019 01:59
vueJs flash message component (alert)
Vue.component('child', {
ready(){
// send flash message
this.$root.$broadcast('flashMessage',{
text: 'Better check yourself, you\'re not looking too good.',
type: 'warning',//optional
important: false,//optional
timeout: 5000//optional
});
@gatlin
gatlin / 1-js-lenses.md
Last active February 11, 2024 04:27
Simple implementation of lenses in JavaScript

What is a lens?

Note: you can copy the file 2-lenses.js below over to repl.it and play along from home!

A lens in programming, much like a lens in the real world, allows you to focus in on a small part of a larger whole and then do something with or to

@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@keopx
keopx / import_gzip_drush.sh
Created July 16, 2015 18:36
Import gzipped sql using Drush
gunzip -c database.sql.gz | drush sqlc

#How you get Sail.js running on Openshift#

This instruction is tested with:

  • Sails.js v0.9.16
  • Node.js 0.10 on Openshift ( 05 May 2014)

###1) package.json

If you use the package.json build by sails new Projectname than you have to add a few fields for openshift – so the server can start you app automatically. Sails uses Grunt to build minify css/js and so on. Openshift dont have grunt installed so you have to add this also.

@umidjons
umidjons / pdf-thumbnail-php.md
Last active December 6, 2023 21:41
Creating PDF thumbnails in PHP

Creating PDF thumbnails in PHP

Install Ghostscript

Download and install right version of ghostscript. In my case my PHP was x86 architecture, so I download Ghostscript 9.14 for Windows (32 bit).

Enable ImageMagick

@dylanjha
dylanjha / script.js
Created July 16, 2013 23:21
a little javascript flash message. see demo at: http://jsfiddle.net/dylanjha/kca9p/
<div id='nav'>
<ul class='nav-list'>
<li class='nav-item'><a href="javascript://">Home</a></li>
<li class='nav-item'><a href="javascript://">There</a></li>
</ul>
</div>
<div id='flash-container' class='flash-container'>
</div>
<div id='content'>
Here is some content.