Skip to content

Instantly share code, notes, and snippets.

View vladdancer's full-sized avatar
🖖

Vlad Moyseenko vladdancer

🖖
View GitHub Profile
@iGhost
iGhost / upwork_additional_calculations.js
Created July 20, 2015 08:08
Additional calculations for Upwork reports (GreaseMonkey script)
// ==UserScript==
// @name UpWork additional calculations
// @namespace Ghost
// @include https://www.upwork.com/reports/*
// @version 1
// @grant none
// ==/UserScript==
var myRate = 22;
var wFee100 = 4.95;
@bojanz
bojanz / extension-patterns.md
Last active January 14, 2023 16:59
Extension patterns: events, tagged services, plugins

This documentation is destined for drupal.org. Created first as a gist to make initial comments easier. Rewrites and clarifications welcome. Code samples are simplified for clarity. Perhaps a bit too much?

When talking about extensibility, there are several distinct use cases:

  1. Reacting to an action that has already happened.

The reaction can be anything; outputting a message, sending an email, modifying a related object, etc. Examples:

  • "A node has been saved"
  • "A product has been added to the cart".
@soifou
soifou / install-ut-goty-debian-64bits.md
Last active January 29, 2025 23:41
Install Unreal Tournament GOTY on Debian Jessie 64bits

Install Unreal Tournament GOTY on Debian 64bits

Run natively Unreal Tournament Game Of The Year (GOTY) on Debian system.

UT is not dead! The install process is a bit cumbersome but the game has been published more than 20 years ago! Please let me know how it went for you and if you have any tips, please share :)

And most important, have fun!

(Tested on Debian Bullseye 64bits)

@crittermike
crittermike / gist:7b654d3d686a4e434eda
Created March 26, 2015 00:56
Run a single specific Drupal update hook using Drush
drush php-eval "module_load_install('MYMODULE'); MYMODULE_update_NUMBER();"
Security Updates Best Practices
==================================
The general workflow for running security updates is:
1. Make sure your local development environment for the site is up-to-date (sync the database from production, if needed)
1. If the site hasn't been managed for a long time, use `drush rsync @example.prod @example.local` (using the `--exclude` flag to exclude large directories like `sites/default/files`). Then type `git status`. If there are any unmanaged files, add them to version control.
2. In your local environment, run `drush up --security-only`.
1. Look at the list of packages that will be updated. Go to each project page on Drupal.org and read the release notes.
2. You may need to read several versions worth of release notes. You want to see if there are mentions of breaking changes or any changes to features/functionality your site uses. This is usually the most time consuming and difficult part of running the updates.
@hilukasz
hilukasz / Selected_layers-PS.jsx
Last active January 3, 2025 21:07
get array of selected layers in photoshop via extendscript
var docRef = app.activeDocument;
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };
function newGroupFromLayers(doc) {
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putClass( sTID('layerSection') );
@hsiboy
hsiboy / VBOX_E_INVALID_VM_STATE.md
Last active September 29, 2024 21:39
rescue a VM from VBOX_E_INVALID_OBJECT_STATE

Issue

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Clearing any previously set forwarded ports...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
@matglas
matglas / reset.sh
Created September 11, 2014 21:06
Platform reset.sh for kraftwagen skeleton development
#!/bin/bash
# Reset
sudo rm -rf cnf/settings.php
sudo rm -rf cnf/files
sudo rm -rf builds
sudo rm -rf build
sudo rm -rf src
# Create new project.
@rothgar
rothgar / main.yml
Last active April 28, 2025 04:18
Generate /etc/hosts with Ansible
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
@julionc
julionc / 00.howto_install_phantomjs.md
Last active March 24, 2025 17:27
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev