Skip to content

Instantly share code, notes, and snippets.

Allen Eubank adeubank

Block or report user

Report or block adeubank

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@adeubank
adeubank / select_dates_between_two_dates.sql
Created Sep 4, 2018
Select all days between two dates
View select_dates_between_two_dates.sql
select * from
(select adddate('1970-01-01',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) selected_date from
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4) v
where selected_date between '2018-07-01' and curdate()
@adeubank
adeubank / finding_sidekiq_jobs.rb
Created Aug 29, 2018
Deleting Sidekiq Jobs From Queue, Scheduled, and Retry
View finding_sidekiq_jobs.rb
# find them in a queue
queue = Sidekiq::Queue.new("default")
jobs = queue.map do |job|
if job.klass == '[JOB_CLASS]'
{job_id: job.jid, job_klass: job.klass, arguments: job.args}
end
end.compact
# the retry queue
retries = Sidekiq::RetrySet.new.select
View unity_stuff.cs
// find a game object in the active scene
using System.Linq;
GameObject worldGameObject =
GameObject.FindGameObjectsWithTag("World").ToList().Find(o => o.scene == activeScene);
if (worldGameObject != null)
{
Debug.Log("SetTrigger: SceneExit" + worldGameObject.name);
worldGameObject.GetComponent<Animator>().SetTrigger("SceneExit");
}
else
View handle_and_retry_errors.rb
def my_fun
vals = []
(1..5).each do |i|
puts "my_fun i=#{i}"
begin
handle_catchable_errors do
vals << unsafe_fun(i)
end
rescue KnownError => e
View wait_until_done.sh
#!/bin/bash
#
# USAGE: wait_until_done PID
#
# wait_until_done watches a process passed in as the first argument waits until
# it finishes
#
# Print the header comment from this file, ducking the shebang line, and stopping a the first line that doesn't start with a hash
function print_header_comment {
@adeubank
adeubank / idea64.exe.vmoptions
Created Jun 7, 2017 — forked from edwardbeckett/idea64.exe.vmoptions
Java 8 Intellij 64 JVM Options
View idea64.exe.vmoptions
-server
-Xms2g
-Xmx2g
-Xss16m
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:ConcGCThreads=4
-XX:ReservedCodeCacheSize=128m
-XX:+AlwaysPreTouch
-XX:+TieredCompilation
@adeubank
adeubank / IntelliJ_IDEA__Perf_Tuning.txt
Last active Jun 7, 2017 — forked from P7h/IntelliJ_IDEA__Perf_Tuning.txt
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
View IntelliJ_IDEA__Perf_Tuning.txt
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@adeubank
adeubank / INSTALL.md
Last active Feb 3, 2018
Setting up automysqlbackup for backups everyday at 3AM and then saving with S3. Need to configure s3cmd with credentials and automysqlbackup. Assumes that all the backups are stored in `/backups`
View INSTALL.md
$ sudo su
$ apt-get update
$ apt-get install s3cmd automysqlbackup
$ s3cmd --configure
# enter access key and secret and other details
$ vim /etc/default/automysqlbackup
# Set these variables
#   USERNAME
#   PASSWORD
@adeubank
adeubank / ruby-vagrant-provision.sh
Last active Jan 15, 2016 — forked from johanneswuerbach/rails-vagrant-provision.sh
Provision a vagrant box with ruby stable (using rvm)
View ruby-vagrant-provision.sh
#!/usr/bin/env bash
sudo locale-gen en_US.UTF-8
sudo update-locale LANG=en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y build-essential git curl libxslt1-dev libxml2-dev libssl-dev nodejs
ln -s /usr/bin/nodejs /usr/bin/node
@adeubank
adeubank / Vagrantfile
Created Dec 21, 2015
Vagrantfile for setting up Ubuntu 14.04 with Java 8 and Tomcat 8
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
You can’t perform that action at this time.