Skip to content

Instantly share code, notes, and snippets.

View tspringborg's full-sized avatar
💭
I may be slow to respond.

tspringborg

💭
I may be slow to respond.
  • Magnificent.pizza
  • Copenhagen, Denmark
View GitHub Profile
run nginx from homebrew
run nginx -t and open the config path
update with the config. Change `proxy_pass` to urls you need.
Make sure to match port on your localhost
@tspringborg
tspringborg / git_commands.md
Last active August 10, 2023 13:41
Commands Cheatsheets

Revert back to an old commit

Checkout specific commit

git checkout be9055b .

Add changes to the staging area and commit them:

git add -A
type IntersectingTypes<T, U> = {
[K in Extract<keyof T, keyof U>]: T[K]
}
/** USAGE
interface Boat {
name: string
engine: string
feet: number
}
@tspringborg
tspringborg / gist:aca3fb26992dda63ba939616e2fe49c9
Last active August 29, 2022 07:45
grep package field value
grep -m1 @mypackage/foo package.json | awk -F: '{ print $2 }' | sed 's/[ ",]//g'
@tspringborg
tspringborg / spinner.html
Last active July 9, 2020 08:25
scss spinner
<div class="spinner-container">
<svg class="spinner" width="65px" height="65px" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">
<circle class="path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle>
</svg>
</div>
@tspringborg
tspringborg / walk.js
Last active July 7, 2020 15:14
synchronously recursively list directory files in nodejs with fs
const fs = require('fs');
const walk = function (dir) {
let results = [];
const list = fs.readdirSync(dir);
list.forEach(function(file) {
file = dir + '/' + file;
const stat = fs.statSync(file);
if (stat && stat.isDirectory()) {
/* Recurse into a subdirectory */
results = results.concat(walk(file));
@tspringborg
tspringborg / index.js
Created June 9, 2020 09:59
nodejs index.js for twigjs templates
/*
https://twig.symfony.com/doc/3.x/templates.html (note this is php but syntax is similar (mostly)
https://github.com/twigjs/twig.js/wiki/Implementation-Notes
*/
const fs = require('fs');
const Twig = require('twig');
const renderFunction = Twig.twig;
@tspringborg
tspringborg / keytool commands
Last active April 23, 2020 14:49
Keyhashes from android keystores
#debug build
keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64
#release build
keytool -exportcert -alias <aliasName> -keystore release.keystore | openssl sha1 -binary | openssl base64
#forgot alias of keystore for release build? run this
keytool -v -list -keystore release.keystore
@tspringborg
tspringborg / android deeplink
Last active February 17, 2020 10:10
Pass deeplink to simulators via terminal
@tspringborg
tspringborg / exampleMethodDecorator.ts
Created January 22, 2020 15:31
example methodDecorator typescript
// use like this
/*
@ExampleMethodDecorator({
// whatever....
foo: 2,
bar: 'foobar',
})
*/
export function ExampleMethodDecorator(configuration?: any): MethodDecorator {