Skip to content

Instantly share code, notes, and snippets.

View pascaliske's full-sized avatar
👋
Hi, what's up?

Pascal Iske pascaliske

👋
Hi, what's up?
View GitHub Profile
@tomraithel
tomraithel / recover-lost-git-files.sh
Created August 10, 2018 20:30
Recover from `git reset --hard` before any initial commit has been made
#!/bin/bash
# This script helps to restore important files after someone acidentially
# ran `git reset --hard` before any commit have been made. `git reflog`
# can´t help you in such cases, because it needs at least one commit
# You can only restore files via this approach, if the files have been
# added with `git add` before the reset was executed! If that was not the
# case, then I have bad news for you: This won´t work :(
@sktwentysix
sktwentysix / sketchapp_line_CSS
Last active February 4, 2022 11:34
Convert SketchApp line height to CSS
/*
Sketchapp fro MacOS is a fantastic tool for prototyping, but has some drawbacks that make converting designs to fully functional websites a pain.
One of these is sketchapp's line-height, which doesn't seem to have any relation to CSS line-height values.
This is a simple example of how we can take a line height value from sketch and apply it to a CSS class for styling text:
Lets assume the text in our Sketchapp prototype has a font size of "18px", and line height of "33"...
Our CSS class would look like this:
@CodingDoug
CodingDoug / README.md
Last active November 6, 2022 09:29
Example code from the video "Use async/await with TypeScript in Cloud Functions"

Example code from the video "Use async/await with TypeScript in Cloud Functions"

This is the example code from my video about using async/await with Cloud Functions. I've placed it here in a gist so it's easier to compare the "before" and "after" states for each case.

Watch the video here

The code in this project is licensed under the Apache License 2.0.

Copyright 2018 Google LLC
@aldo-roman
aldo-roman / compress.js
Last active November 11, 2021 13:48
Brotli compression with Angular CLI
const brotli = require('brotli')
const fs = require('fs')
const brotliSettings = {
extension: 'br',
skipLarger: true,
mode: 1, // 0 = generic, 1 = text, 2 = font (WOFF2)
quality: 10, // 0 - 11,
lgwin: 12 // default
}
@doitian
doitian / gitlab.conf
Last active April 26, 2019 14:02
gitlab supervisord config
[program:unicorn]
command=bash -c 'rm -f /home/git/gitlab/tmp/sockets/gitlab.socket /home/git/gitlab/tmp/pids/unicorn.pid && /home/git/gitlab/bin/web start_foreground'
autostart=true
autorestart=true
stopsignal=TERM
user=git
directory=/home/git/gitlab
environment=RAILS_ENV="production"
stdout_logfile=NONE
stderr_logfile=/home/git/gitlab/log/unicorn.stderr.log
@samthor
samthor / safari-nomodule.js
Last active February 14, 2024 02:54
Safari 10.1 `nomodule` support
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that
// does not support `nomodule` is probably not being used anywhere. The code below is left
// for posterity.
/**
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
*
* Again: this will **not** prevent inline script, e.g.:
@mjj2000
mjj2000 / get-current-git-tag.sh
Last active June 4, 2024 14:55
[GIT] Get tag of current branch(that is HEAD) or fallback to short commit hash(7 digits) by single shell command
git describe --exact-match --tags 2> /dev/null || git rev-parse --short HEAD
@btroncone
btroncone / ngrxintro.md
Last active June 26, 2024 08:27
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

@Dynalon
Dynalon / jsx-render.tsx
Created January 7, 2016 21:23
Sample JSX to HTMLElement renderer in TypeScript
// Tiny JSX renderer in TypeScript inspired by plain-jxs: https://github.com/callumlocke/plain-jsx
// Babel would allow you to specify the factory function as special inline comment:
/** @jsx JSXrender */
let JSXrender = (tagName: string, attributes?: { [key: string]: any }, ...children: Array<HTMLElement |  string>): HTMLElement => {
if (!tagName || typeof tagName !== 'string')
throw new Error("tagName has to be defined, non-empty string");
@monicao
monicao / react.md
Last active February 23, 2021 19:07
React Lifecycle Cheatsheet

React Component Lifecycle

  • getInitialState
  • getDefaultProps
  • componentWillMount
  • componentDidMount
  • shouldComponentUpdate (Update only)
  • componentWillUpdate (Update only)
  • componentWillReceiveProps (Update only)
  • render