Skip to content

Instantly share code, notes, and snippets.

View m0veax's full-sized avatar
🐱
🥙

Patrick Kilter m0veax

🐱
🥙
  • Vivawest Wohnen GmbH
  • Germany, Gladbeck
View GitHub Profile
@noelboss
noelboss / git-deployment.md
Last active April 1, 2025 16:56
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@benpickles
benpickles / action.js
Created March 18, 2016 16:19
Inject an Authorization header into a redux-api-middleware request with a Redux middleware.
import { CALL_API } from 'redux-api-middleware'
export function fetchLocations() {
return {
[CALL_API]: {
endpoint: 'http://api.somesite.com/api/locations',
method: 'GET',
// Don't have to manually add the Authorization header to every request.
headers: { 'Content-Type': 'application/json' },
types: ['REQUEST', 'SUCCESS', 'FAILURE']
@skratchdot
skratchdot / dexieDeleteAllDbs.js
Created December 15, 2015 14:11
Delete all Dexie.js databases
Dexie.getDatabaseNames(function (names, cb) {
console.log('database names: ', names);
names.forEach(function (name) {
var db = new Dexie(name);
db.delete().then(function() {
console.log('Database successfully deleted: ', name);
}).catch(function (err) {
console.error('Could not delete database: ', name, err);
}).finally(function() {
console.log('Done. Now executing callback if passed.');
#!/usr/bin/env perl
# plackuo minimal.pl
use FindBin();
use Plack::App::File;
my $app = Plack::App::File->new( root => "$FindBin::Bin/");
@gokulkrishh
gokulkrishh / media-query.css
Last active April 22, 2025 04:29
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@yohangdev
yohangdev / pre-commit
Created September 2, 2015 07:27
Git Pre-Commit Hooks Write Commit Hash to File
#!/usr/bin/env bash
set -e
#=== 'prev-commit' solution by o_O Tync
#commit_hash=$(git rev-parse --verify HEAD)
commit=$(git log -1 --pretty="%H%n%ci") # hash \n date
commit_hash=$(echo "$commit" | head -1)
commit_date=$(echo "$commit" | head -2 | tail -1) # 2010-12-28 05:16:23 +0300
branch_name=$(git symbolic-ref -q HEAD) # http://stackoverflow.com/questions/1593051/#1593487
@mkropat
mkropat / Migrate-Db.ps1
Last active January 25, 2019 17:59
Run schema migration scripts on a SQL Server databse
<#
.SYNOPSIS
Run schema migration scripts on a SQL Server databse
.DESCRIPTION
The database version is kept track of in an extended property ('db-version') on
the SQL Server database. The version number comes from the prefix of the
filename of each .sql migration script (see -SchemaDir parameter help for more
information).
@Koalabaerchen
Koalabaerchen / MaintenanceListener.php
Last active March 11, 2023 18:31
Maintenance Mode for Symfony
<?php
/**
* Based on http://www.wenigersh.com/blog/post/maintenance-mode-for-symfony-2-applications
*
* Includes support of user permisson check (here: check if user has role ADMIN), so admins can still surf the site while in maintenance mode
* Be aware that if you clear the cache (to start maintenance in prod environment) your sessions might be cleared as well, so people get logged out
* The config.yml will move the sessions to /app/sessions/[environment]
*
* Also be aware that you need at least Symfony 2.6 for this permission check. For older versions the call is different
* @see http://symfony.com/blog/new-in-symfony-2-6-security-component-improvements
@JuggoPop
JuggoPop / Git branch bash autocomplete *with aliases*
Created April 15, 2014 06:23
Git branch bash autocomplete *with aliases* (add to .bash_profile)
# To Setup:
# 1) Save the .git-completion.bash file found here:
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
# 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect:
# Git branch bash completion
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
# Add git completion to aliases
@jo
jo / js-crypto-libraries.md
Last active January 16, 2025 12:08
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.