Skip to content

Instantly share code, notes, and snippets.

@mtyeh411
mtyeh411 / git-remove-branches
Created April 15, 2020 14:48 — forked from TBonnin/git-remove-branches
Safely remove local fully merged branches
#!/bin/bash
# This has to be run from master
git checkout master
# Update our list of remotes
git fetch
git remote prune origin
# Remove local fully merged branches
@mtyeh411
mtyeh411 / clear-sidekiq-jobs.sh
Created November 20, 2019 21:41 — forked from wbotelhos/clear-sidekiq-jobs.sh
Clear Sidekiq Jobs
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
# 3. Clear 'Processed' and 'Failed' jobs
@mtyeh411
mtyeh411 / better-nodejs-require-paths.md
Created October 7, 2019 21:20 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

Erlang/Elixir syntax reference

This reference is aimed at allowing you to comfortably read erlang documentation and consume terms printed in Erlang format. It does not aim at allowing you to write Erlang code.

This is a modified version of http://elixir-lang.org/crash-course.html

Data types

Erlang and Elixir have the same data types for the most part, but there are a number of differences.

@mtyeh411
mtyeh411 / SassMeister-input.scss
Created December 9, 2015 18:23
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$test: 'testing';
.btn-#{$test} {
color: blue;
}
@mtyeh411
mtyeh411 / LICENSE.txt
Last active August 29, 2015 14:06 — forked from addyosmani/README.md
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2014
Copyright (C) 2014 Addy Osmani @addyosmani
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@mtyeh411
mtyeh411 / SMW_refreshData.sh
Created July 30, 2013 21:21
cron this for sane Semantic MediaWiki data refreshes
#!/usr/bin/env bash
PIDDIR="/var/run/wiki"
mkdir -p $PIDDIR
PIDFILE="$PIDDIR/SMW_refreshData.pid"
SMW_DIR="/ebs/var/www/html/w/extensions/SemanticMediaWiki"
LOG_DIR="/var/log/wiki"
REFRESH_RATE=20
@mtyeh411
mtyeh411 / MW_runJobs.sh
Last active December 20, 2015 10:39
cron this for a sane MediaWiki job runner
#!/usr/bin/env bash
WIKI_DIR="/var/www/html/w"
LOG_DIR="/var/log/wiki"
PIDDIR="/var/run/wiki"
mkdir -p $PIDDIR
JOBS=( "refreshLinks" "refreshLinks2" "SMWUpdateJob" "replaceText" "htmlCacheUpdate" "spsCreatePage" )
MAXJOBS=10
@mtyeh411
mtyeh411 / task_scheduler.rb
Created September 5, 2012 12:29
scheduled pinger
require 'rufus/scheduler'
scheduler = Rufus::Scheduler.start_new
scheduler.every '10m' do
require "net/http"
require "uri"
url = 'http://codeglot.com'
Net::HTTP.get_response(URI.parse(url))
end
@mtyeh411
mtyeh411 / Widget:DataTables_Form
Created August 27, 2012 02:00
SMW_DataTables & SPS_PageIterator MW Widget
<noinclude>
This [http://www.mediawiki.org/wiki/Extension:Widgets widget] is meant to be used with an instance of [http://www.datatables.net DataTables jQuery plugin] on the page and a form link created from the [http://www.mediawiki.org/wiki/Extension:Semantic_Page_Series Semantic Page Series] <nowiki>{{#serieslink:}}</nowiki> parser function to a page iterator. The [https://github.com/mtyeh411/semantic_mediawiki-datatables Semantic MediaWiki DataTables result format] can be used as a DataTables instance.
This widget adds multiple selection highlighting on the DataTable instance. The values of the selected DataTable rows are used as inputs to the Semantic Page Series pagenames value for the Semantic Page Series page iterator.
Just add the following anywhere on the page where you have a DataTable and a SPS link
<pre>
{{#widget: DataTables Form | pagenames=<SPS page iterator pagenames value>}}
</pre>
</noinclude>