Skip to content

Instantly share code, notes, and snippets.

View albertski's full-sized avatar

Albert Jankowski albertski

View GitHub Profile
@albertski
albertski / my-aliases.md
Last active August 3, 2023 17:39
My Aliases

My Aliases

alias gitclean="git branch --merged | egrep -v \"(^*|master|main)\" | xargs git branch -d; git remove prune origin"
@albertski
albertski / email_hash.rb
Created August 13, 2020 04:42
Hash Email Address
require 'digest/md5'
email_hash = Digest::MD5.hexdigest("albertski@hey.com")
puts email_hash
@albertski
albertski / rwdurl
Created September 16, 2016 14:05 — forked from zachleat/rwdurl
A command line utility to open a url with a bunch of different screen widths (and organize the windows).
#!/bin/bash
display_usage() {
echo "This script should be run with one argument."
echo "Example: rwulr http://www.siteurl.com"
}
if [ $# -le 0 ]
then
display_usage
@albertski
albertski / get_month_name.php
Last active August 3, 2016 20:48
Get Month Name From Number
<?php
/**
* Get month name from integer.
*
* @param integer $month_number Month number.
*
* @return string Month name.
*/
function get_month_name($month_number) {
@albertski
albertski / Sublime Settings
Created June 6, 2016 15:27
Sublime Settings for Drupal Development
{
"color_scheme": "Packages/Theme - Soda/Monokai Soda.tmTheme",
"default_line_ending": "unix",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"extensions":
[
"module",
"install",
"inc"
@albertski
albertski / gist:6af957aba26c5419ae48
Last active March 6, 2018 22:44
Get Embed View With Title
<?php
/**
* Embed a view with a title. Pretty much copying the views_embed_view() but
* adding the ability to display title.
*
* @param string $name The name of the view to embed.
* @param string $display_id The display id to embed. If unsure, use 'default',
* as it will always be valid. But things like 'page'
* or 'block' should work here.
* @param string $title_tag The html header tag (h1, h2, h3, etc..).
<?php
/**
* Process the form.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* @param \Symfony\Component\Form\FormInterface $form
* @param boolean $removeExtraFields
*/
private function processForm(Request $request, FormInterface $form, $removeExtraFields = FALSE)
{