Skip to content

Instantly share code, notes, and snippets.

View ignasbernotas's full-sized avatar
🎉

Ignas Bernotas ignasbernotas

🎉
View GitHub Profile
@ignasbernotas
ignasbernotas / SetModelAttributes.php
Last active July 5, 2022 12:53
A super simple artisan command to generate setting model properties
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
class SetModelAttributes extends Command
{
@rmcdongit
rmcdongit / macOS_SytemPrefs.md
Last active July 11, 2024 07:21
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane
@Eseperio
Eseperio / all-file-extensions.json
Created July 16, 2019 09:50
List of all file extensions with description (listed on wikipedia) in JSON format.
{
"0": {
"descriptions": [
"Compressed harddisk data"
]
},
"1": {
"descriptions": [
"Fax",
"Roff/nroff/troff/groff source for manual page"
@troyfontaine
troyfontaine / 1-setup.md
Last active July 23, 2024 23:25
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@gAmUssA
gAmUssA / Open iterm tab here
Last active October 28, 2023 19:40 — forked from eric-hu/Open iterm tab here
Apple script to open an iterm2 tab from right-clicking on a file or folder in Finder.To use:(1) Open Automator(2) Create a new service(3) Change "Service receives selected" drop downs to "Files or folders" in "Finder"(4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
-- Modified to work with iTerm 2 night builds https://iterm2.com/applescript.html
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
@jaceklaskowski
jaceklaskowski / deployment-tool-ansible-puppet-chef-salt.md
Last active January 3, 2024 22:12
Choosing a deployment tool - ansible vs puppet vs chef vs salt

Requirements

  • no upfront installation/agents on remote/slave machines - ssh should be enough
  • application components should use third-party software, e.g. HDFS, Spark's cluster, deployed separately
  • configuration templating
  • environment requires/asserts, i.e. we need a JVM in a given version before doing deployment
  • deployment process run from Jenkins

Solution

@Exadra37
Exadra37 / laravel-tips.md
Last active December 5, 2017 19:23
Laravel Tips

LARAVEL TIPS

4. Bulk Insert On Duplicate Key Update

<?php
    /**
     * When we want to perform a bulk insert we will not found support for this action in Eloquent or Query Builder
     * To avoid performance issues i have to drop my preference to be database agnostic in my Apps
     * To be used like:
     *     $table   = 'table_name';
@daniel-j
daniel-j / spotify.js
Last active January 6, 2024 04:19
A simple node.js program to listen to Spotify tracks, albums and playlists
#!/usr/bin/env node
'use strict';
/*
This is a simple Spotify cli-based client with optional Icecast2/shout support!
It should work for non-premium users, but you must connect your Spotify account to Facebook.
Usage:
$ node spotify <spotify uris> <playlist uri> <album uri> <track uri> <etc...>
@andredublin
andredublin / timezones.txt
Created August 21, 2012 15:29
list of gmt timezones in different languages
/*
|--------------------------------------------------------------------------
| GMT Timezones
|--------------------------------------------------------------------------
|
| List GMT Timezones
*/
************ PHP ************
$timezones = array(