Skip to content

Instantly share code, notes, and snippets.

View macmladen's full-sized avatar

Mladen Đurić macmladen

View GitHub Profile
@eojthebrave
eojthebrave / entity_fields.php
Created July 1, 2021 14:54
Output a CSV file listing all fields and properties for Drupal 7 entity types to help prepare for a migration.
<?php
/**
* @file
* Create a CSV file with fields for every Drupal 7 entity type / bundle.
*
* When preparing for a Drupal 7 to Drupal 8/9 migration it can be helpful to
* perform some initial content analysis. This script creates CSV files that
* can be imported into Google Sheets etc. to help with this analysis.
*
@tajnymag
tajnymag / tinder.user.js
Last active March 10, 2024 18:59
Tinder Deblur Userscript (ARCHIVED and DEPRECATED, see https://github.com/tajnymag/tinder-deblur)
// ==UserScript==
// @name Tinder Deblur
// @namespace Violentmonkey Scripts
// @match https://tinder.com/*
// @grant none
// @version 1.4
// @author Tajnymag
// @downloadURL https://raw.githubusercontent.com/tajnymag/tinder-deblur/main/tinder.user.js
// @description Simple script using the official Tinder API to get clean photos of the users who liked you
// ==/UserScript==
@cetinajero
cetinajero / ddrescue.md
Last active April 10, 2024 03:46
Guide for using Ddrescue to recover data

Guide for using Ddrescue to recover data

Start command:

ddrescue -d /dev/sda output.img output.mapfile

NOTE: If direct disc access is not available in your system, try raw devices.

@Bhavdip
Bhavdip / sketch-never-ending.md
Created October 6, 2016 15:53
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@ralphschindler
ralphschindler / README.md
Last active September 30, 2023 19:28
Docker For Mac Host Address Alias To Enable PHP XDebug (10.254.254.254 Trick)

Docker (Mac) De-facto Standard Host Address Alias

This launchd script will ensure that your Docker environment on your Mac will have 10.254.254.254 as an alias on your loopback device (127.0.0.1). The command being run is ifconfig lo0 alias 10.254.254.254.

Once your machine has a well known IP address, your PHP container will then be able to connect to it, specifically XDebug can connect to it at the configured xdebug.remote_host.

Installation Of IP Alias (This survives reboot)

Copy/Paste the following in terminal with sudo (must be root as the target directory is owned by root)...

@seltzered
seltzered / gist:3b627104c8a7a39b863c
Last active October 21, 2022 18:17
Mac OSX Set Sound Output to Internal Speakers.applescript
-- Script to set sound output - "Internal Speakers" hardcoded as I just keep multiple scripts for each output source (e.g. Internal Speakers, Airplay, bluetooth ) and use it with a quicklaunch app such as quicksilver.
-- Based off of Pierre L's answer in https://discussions.apple.com/thread/4629093?tstart=0 , which includes a selection dialog
set asrc to "Internal Speakers"
tell application "System Preferences"
reveal anchor "output" of pane id "com.apple.preference.sound"
activate
@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active April 25, 2024 22:55
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@ryanjbonnell
ryanjbonnell / setup.sh
Created October 8, 2014 22:17
Install SassC + LibSass for Mac OS X 10.9 "Mavericks"
# Install SassC Interpreter
$ cd /usr/local/src
$ curl -kL https://github.com/hcatlin/libsass/archive/master.zip > libsass.zip
$ unzip libsass.zip
# Install LibSass Library
$ cd /usr/local/src
$ curl -kL https://github.com/sass/sassc/archive/master.zip > sassc.zip
$ unzip sassc.zip
@jameswilson
jameswilson / localized_placeholder_node_and_menu_item.php
Created August 25, 2014 23:55
Programmatically create a placeholder node with translations and localized main menu links.
<?php
// The following code snippet is used to add a placeholder page and companion
// localized menu items to a site with i18n_menu and entity_translation enabled.
/**
* Create an About page.
*/
function mymodule_create_about_page() {
// Config data.
@kimmobrunfeldt
kimmobrunfeldt / 0-osx-for-web-development.md
Last active July 26, 2022 13:30
Install web development tools to Mavericks (OS X 10.9)

Install web development tools to Mavericks (OS X 10.9)

Strongly opinionated set of guides to quickly setup OS X Mavericks for web development. By default OS X hides stuff that normal people don't need to see. These settings are better defaults for developers.

I don't want: any sounds, annoying confirmation dialogs, hidden extensions, superflous animations, unnecessary things running like Dashboard, Notification center or Dock(Alfred/spotlight works better for me).

These are my opinions. Read this document through and pick up the good parts to your preferences.

System preferences