Skip to content

Instantly share code, notes, and snippets.

View sean-gilmore's full-sized avatar
🥦

Sean sean-gilmore

🥦
View GitHub Profile
@samhernandez
samhernandez / haxor.twig
Last active December 2, 2022 21:40
Craft 3 gain access to admin account for support cases or when owner loses access
{#
Resets the username, password, and email address
of the first found Admin account in case of
lost admin access or for support cases.
#}
{% set values = {
username: 'me',
password: craft.app.security.hashPassword('mypassword'),
email: 'me@site.com',
passwordResetRequired: 0
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active September 22, 2024 19:46
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@JeremyKruman
JeremyKruman / 2WaySplit.js
Last active December 2, 2017 15:17
Custom CSS to be used with the Custom CSS and JS Loader extension to create a horizontal and vertical split layout in Visual Studio Code
//Adds an event handler to an object
function addEvent(obj, type, fn) {
if (obj.addEventListener)
obj.addEventListener(type, fn);
else if (obj.attachEvent)
obj.attachEvent('on' + type, function () { return fn.apply(obj, [window.event]); });
};
window.onload = function () {
//Give the UI 10 seconds to load (not doing this resulted in the elements not being found).
@noelboss
noelboss / git-deployment.md
Last active September 4, 2024 16:25
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@ThawanFidelis
ThawanFidelis / preview_devise_mail.rb
Last active July 14, 2023 16:05
Preview Devise Mails
# config/enviroments/development.rb
config.action_mailer.preview_path = "#{Rails.root}/app/mailer_previews"
# app/mailer_previews/devise_mailer_preview.rb
class Devise::MailerPreview < ActionMailer::Preview
def confirmation_instructions
Devise::Mailer.confirmation_instructions(User.first, {})
end
##Create a migration
### rails g migration make_unicode_friendly
class MakeUnicodeFriendly < ActiveRecord::Migration
def change
alter_database_and_tables_charsets "utf8", "utf8_general_ci"
end
private
def alter_database_and_tables_charsets charset = default_charset, collation = default_collation
@smileart
smileart / README.md
Last active March 16, 2024 15:42 — forked from agnoster/README.md
My ZSH Theme — Agnoster Mod

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

Compatibility

@tpennock-gist
tpennock-gist / Wordpress Post Sorting
Created July 20, 2012 16:25
Wordpress Post Sorting for 'popular' and 'newest', captures post view count and sets it in the DB for each post (popularity factor), captures query string parameters for minor class replacements of the filter buttons (for css)
<?
// Place this code into your archive.php template file
$filter = $_GET['filter'];
// Preserve existing query parameters
global $wp_query;
// Check query string parameter "filter" (options: 'popular' and 'newest')
if((isset($filter)) && $filter == 'popular'){
$args = array_merge( $wp_query->query, array('order' => 'desc', 'orderby' => 'meta_value_num', 'meta_key' => 'post_views_count') );