Skip to content

Instantly share code, notes, and snippets.

View gitowiec's full-sized avatar
🎯
Focusing

Marek gitowiec

🎯
Focusing
  • Gdańsk
View GitHub Profile
@nverinaud
nverinaud / javascript-prototyping-best-practices.js
Created November 11, 2012 10:03
Javascript Prototyping Best Practices
'use strict';
/*
# Javascript Prototyping Best Practices
* To create a class, create a constructor function with a `Name` and assign
it to a variable of the same `Name`.
* In this constructor only define properties using `this.prop` notation
@teppeis
teppeis / jquery-release-notes.md
Last active November 21, 2022 16:10
jQuery Release Notes
@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@loopdream
loopdream / openInNewTab.js
Last active October 29, 2018 11:15
Open link in new tab - checks for popup blocker
openInNewTab = function(url) {
var popupBlockerChecker = {
check: function(popup_window){
var _scope = this;
if (popup_window) {
if(/chrome/.test(navigator.userAgent.toLowerCase())){
setTimeout(function () {
_scope._is_popup_blocked(_scope, popup_window);
},200);
}else{
@think49
think49 / es6-weakmap.js
Last active July 1, 2017 21:46
es6-weakmap.js: ECMA-262 6th Edition (ECMAScript 2015) WeakMap polyfill
/**
* es6-weakmap.js
* WeakMap (ECMA-262 6th Edition / ECMAScript 2015)
*
*
* @version 0.9.2
* @author think49
* @url https://gist.github.com/think49/283b7374e352e09fc131
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
* @see <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-weakmap-constructor">23.3.1 The WeakMap Constructor – ECMA-262 6th Edition</a>

Automatically Prepend a Jira Issue ID to Git Commit Messages

Use a git hook to match a Jira issue ID from the current branch, and prepend it to every commit message

Assuming the current branch contains a Jira issue ID, you can use a git hook script to prepend it to every commit message.

  1. Create an empty commit-msg git hook file, and make it executable. From your project's root directory:

     install -b -m 755 /dev/null .git/hooks/commit-msg
    
  2. Save the following script to the newly-created .git/hooks/commit-msg file:

@alirobe
alirobe / reclaimWindows10.ps1
Last active June 7, 2024 16:24
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active June 5, 2024 21:05
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@retlehs
retlehs / sync-prod.sh
Last active January 26, 2022 03:48
WP-CLI aliases sync example
read -r -p "Would you really like to reset your development database and pull the latest from production? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then
wp @development db reset --yes &&
wp @production db export - > sql-dump-production.sql &&
wp @development db import sql-dump-production.sql &&
wp @development search-replace https://example.com https://example.dev
fi
const colorGroups = [
// PINK
"#FFC0CB",
"#FFB6C1",
"#FF69B4",
"#FF1493",
"#DB7093",
"#C71585",
// PURPLE
"#E6E6FA",