Skip to content

Instantly share code, notes, and snippets.

View keinajar's full-sized avatar

Jari Keinänen keinajar

View GitHub Profile
#!/bin/bash
mkdir git-stash-test
cd git-stash-test
mkdir component
mkdir common
touch component/a.scss component/b.scss common/c.scss
git init .
git add .
git commit -m "Added files"
@keinajar
keinajar / maintenance-page.tpl.php
Created June 7, 2016 06:46
Most simple, textual maintenance page template for Drupal 7
<!DOCTYPE html>
<html>
<head><title><?= $head_title ?></title></head>
<body><?= $content ?></body>
</html>
var options = {
namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin
selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
animation: "fade", //String: Select your animation type, "fade" or "slide"
easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
reverse: false, //{NEW} Boolean: Reverse the animation direction
animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
startAt: 0, //Integer: The slide that the
@keinajar
keinajar / backward_explode.php
Last active August 29, 2015 14:01
Split a string by string (like explode()) backwards. See http://stackoverflow.com/q/16610791/216129
<?php
/**
* Split a string by string (like explode()) backwards.
*
* @param string $delimiter <p>The boundary string</p>
* @param string $string <p>The input string</p>
* @param int $limit <p>
* If limit is set and positive, the returned array will contain
* a maximum of limit elements counting from the end of the string with the first
function exportFileToPNG(dest, artBoardIndex)
{
var exportOptions = new ExportOptionsPNG24(); // or ExportOptionsPNG8
var type = ExportType.PNG24; // or ExportType.PNG8
var file = new File(dest + ".png");
exportOptions.artBoardClipping = true;
exportOptions.antiAliasing = true;
exportOptions.transparency = true;
exportOptions.qualitySetting = 72;
@keinajar
keinajar / flux-temp
Last active December 27, 2015 22:19
Sets OS X display temperature using Flux. Requires Flux: http://justgetflux.com/ Inspired by Kelvin: http://apple.stackexchange.com/a/51589/1453 Be sure to check "Custom" as "Lighting at night" preference in Flux.
#!/bin/bash
# Sets OS X display temperature using Flux.
# Requires Flux: http://justgetflux.com/
# Inspired by Kelvin: http://apple.stackexchange.com/a/51589/1453
# Be sure to check "Custom" as "Lighting at night" preference in Flux.
declare l r d n night day