Skip to content

Instantly share code, notes, and snippets.

@strarsis
strarsis / indd_page_extract.jsx
Created March 11, 2018 01:15 — forked from bastien/indd_page_extract.jsx
Extracting a page from an InDesign document (2 different approaches)
var doc = app.activeDocument;
if(doc.saved == true)
{
extract(2);
}
else
{
alert("Save you file.");
}
@strarsis
strarsis / functions.php
Created March 5, 2018 22:53 — forked from kloon/functions.php
WooCommerce Dropdown Product Quantity, fully compatible with Min/Max quantities extension
<?php
// Place the following code in your theme's functions.php file
// override the quantity input with a dropdown
function woocommerce_quantity_input() {
global $product;
$defaults = array(
'input_name' => 'quantity',
'input_value' => '1',
'max_value' => apply_filters( 'woocommerce_quantity_input_max', '', $product ),
@strarsis
strarsis / docker-env
Created January 16, 2018 15:46 — forked from mmarchini/docker-env
Docker Env converter from Windows to WSL
#!/usr/bin/env python3
from subprocess import run, PIPE
completed_process = run(["docker-machine.exe", "env", "--shell", "bash"], stdout=PIPE)
docker_env = completed_process.stdout.decode("ascii")
for line in docker_env.split("\n"):
if "DOCKER_CERT_PATH" in line:
@strarsis
strarsis / msysgit2unix-socket.py
Created January 14, 2018 22:33 — forked from kevinvalk/msysgit2unix-socket.py
Updated to better survive crashes and other unexpected behavior.
#!/usr/bin/python
"""
msysGit to Unix socket proxy
============================
This small script is intended to help use msysGit sockets with the new Windows Linux Subsystem (aka Bash for Windows).
It was specifically designed to pass SSH keys from the KeeAgent module of KeePass secret management application to the
ssh utility running in the WSL (it only works with Linux sockets). However, my guess is that it will have uses for other
function tattoo_submit() {
if (isset($_POST["addtattoo"])) {
$title = "Tattoo : ". $_POST["tatooInput"];
$my_post = array(
'post_title' => $title,
'post_status' => 'publish',
'post_author' => 1,
@strarsis
strarsis / one-page-nav.js
Created May 26, 2017 18:40 — forked from jpen365/one-page-nav.js
One-page nav code for twenty seventeen
/*
One page nav code
*/
jQuery( document ).ready(function(){
/* Add padding and id's to each front page section */
jQuery( "h2.entry-title" ).each( function() {
var panelId = jQuery( this ).html().toLowerCase().replace(/\s+/g, "-");
jQuery( this ).wrapInner(function() {
return "<span style='padding-top:96px;' id='" + panelId + "'></span>";
@strarsis
strarsis / change_post_menu_label.php
Created May 20, 2017 13:24 — forked from nciske/change_post_menu_label.php
WordPress Change Post to Article
<?php
/* Change Post to Article */
function change_post_menu_label() {
global $menu;
global $submenu;
$menu[5][0] = 'Articles';
$submenu['edit.php'][5][0] = 'Articles';
$submenu['edit.php'][10][0] = 'Add New';
$submenu['edit.php'][16][0] = 'Tags';
@strarsis
strarsis / gist:fd3c5b3381b1ac5d5534e742063fab6d
Created May 8, 2017 21:41 — forked from seamusleahy/gist:3098949
Create a curve to text using Lettering.js, Sass, and Compass
/* Add a wave alignment to your title text using Sass, Compass, and Lettering.js.
*
* Lettering.js wraps each letter with a span with a class of .char<#>.
* Compass provides math functions including the sin which provides the wave form.
*/
$length: 11; // The word is 11 letters long
@for $i from 1 through $length {
.char#{$i} {
@include transform(translateY( sin(($i - 1)/($length - 1)*2*pi()) * -25px) );
@strarsis
strarsis / deploy-hooks share-after.yml
Created April 2, 2017 21:30 — forked from mockey/deploy-hooks share-after.yml
Add wp language files on trellis deploy
---
- block:
- name: Install language files
command: wp core language install {{ item }}
args:
chdir: "{{ deploy_helper.new_release_path }}"
# check for existance of po-file, language install should only run once:
creates: "{{ deploy_helper.new_release_path }}/web/app/languages/{{ item }}.po"
with_items: "{{ project.languages }}"
@strarsis
strarsis / catVagrantfilePure.sh
Created February 26, 2017 15:36 — forked from fedir/catVagrantfilePure.sh
Strip Vagrantfile from comments and empty lines
#!/bin/bash
cat Vagrantfile | grep -vE '(^[[:space:]]*($|(#|!|;|//)))'
cat Vagrantfile | grep -vE '(^[[:space:]]*($|(#)))'