Skip to content

Instantly share code, notes, and snippets.

View stewones's full-sized avatar
🐠
Cooking something new.

Stewan stewones

🐠
Cooking something new.
View GitHub Profile
@stewones
stewones / git-reset-author.sh
Created October 15, 2021 01:09 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@stewones
stewones / blob-util.min.js
Created February 14, 2020 21:00 — forked from nolanlawson/blob-util.min.js
Read img tag, store it as a blob, then read it as a blob
!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.blobUtil=e():"undefined"!=typeof global?global.blobUtil=e():"undefined"!=typeof self&&(self.blobUtil=e())}(function(){return function e(t,n,r){function o(u,a){if(!n[u]){if(!t[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(i)return i(u,!0);throw new Error("Cannot find module '"+u+"'")}var f=n[u]={exports:{}};t[u][0].call(f.exports,function(e){var n=t[u][1][e];return o(n?n:e)},f,f.exports,e,t,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(e,t){"use strict";function n(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),o=-1;++o<t;)r[o]=e.charCodeAt(o);return n}function r(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,o=-1;++o<r;)t+=String.fromCharCode(n[o]);return t}function o(e,t){return new L(function(n,r){var o=new Image;t&&(o.crossOrigin=t),o.onload=function(
@stewones
stewones / nginxproxy.md
Created December 6, 2019 01:23 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@stewones
stewones / elasticsearch-docker-script
Created July 9, 2018 21:39 — forked from mschoch/elasticsearch-docker-script
A script to fix ownership of Elasticsearch data directory (when mounted as a volume in docker), then switch to elasticsearch user and launch elasticsearch
#!/bin/sh
# fix permissions (wrong if docker mounted volume)
chown -R elasticsearch:elasticsearch /var/lib/elasticsearch
# now switch to elasticsearch user and run in foreground
echo Starting: /usr/share/elasticsearch/bin/elasticsearch -Des.default.config=$CONF_FILE -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=$LOG_DIR -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=$CONF_DIR $@
su elasticsearch -s /bin/sh -c "/usr/share/elasticsearch/bin/elasticsearch -Des.default.config=$CONF_FILE -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=$LOG_DIR -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=$CONF_DIR $@"
@stewones
stewones / autoresize.ts
Created April 23, 2018 17:21 — forked from kinoli/autoresize.ts
Auto resize directive for TextAreas in Angular 2/4
// An autoresize directive that works with ion-textarea in Ionic 2
// Usage example: <ion-textarea autoresize [(ngModel)]="body"></ion-textarea>
// Usage example: <ion-textarea autoresize="100" [(ngModel)]="body"></ion-textarea>
// Based on https://www.npmjs.com/package/angular2-autosize
import { Directive, HostListener, ElementRef, Input } from "@angular/core";
@Directive({
selector: "ion-textarea[autoresize]" // Attribute selector
})
::-webkit-scrollbar {
height: 16px;
overflow: visible;
width: 12px;
}
::-webkit-scrollbar-button {
height: 0;
width: 0;
}
$breakpoint-alpha: 800px;
.table-search {
display: flex;
padding: 1.3em 1.6em;
input {
font-size: 14px;
flex: 1 1 100%;
box-sizing: border-box;
-webkit-box-flex: 1;
border: none;
let _ = require('lodash');
let games = [
{
name: 'Street Fighter',
year: 1990
},
{
name: 'Mortal Kombat' ,
storeFile=/path/to/key
keyAlias={key-alias}
storePassword={store-pass}
keyPassword={key-pass}
<html>
<head>
<title>mwss Project</title>
<link rel="stylesheet" href="Style.css"/>
<script src="jquery-1.12.3.js"></script>
</head>
<body>
<div class="divzin">