Skip to content

Instantly share code, notes, and snippets.

View joshuapinter's full-sized avatar
🎯
Focusing

Joshua Pinter joshuapinter

🎯
Focusing
View GitHub Profile
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@slavikdev
slavikdev / cheatsheet.md
Created March 16, 2017 17:54
Rails request path cheatsheet

Rails request path cheatsheet

Full path with query string

>>  request.url
=> "http://localhost:3000/ask-help.amp?hui=pizda"

Virtual path without query string

>>  request.path
=> "/ask-help.amp"
@hartfordfive
hartfordfive / verify_s3_file.rb
Created November 1, 2016 17:47
Check if file exists in S3 bucket with Ruby aws-sdk gem
require 'aws-sdk'
s3 = Aws::S3::Resource.new(
region: 'us-east-1',
credentials: Aws::InstanceProfileCredentials.new()
)
bucket = s3.bucket('my-daily-backups')
file = (DateTime.now).strftime("%Y.%m.%d-backup")
if bucket.object(file).exists?
@SIRHAMY
SIRHAMY / gtltexample.html
Created September 18, 2016 04:49
React/JSX: Put greater than and less than symbol in HTML
<div>{"<"} Less than, {">"} greater than </div>
@knowbody
knowbody / RNfontWeights.js
Created July 14, 2016 13:42
React Native Font Weight Cheatsheet iOS
{ fontWeight: '100' }, // Thin
{ fontWeight: '200' }, // Ultra Light
{ fontWeight: '300' }, // Light
{ fontWeight: '400' }, // Regular
{ fontWeight: '500' }, // Medium
{ fontWeight: '600' }, // Semibold
{ fontWeight: '700' }, // Bold
{ fontWeight: '800' }, // Heavy
{ fontWeight: '900' }, // Black
@MarkMurphy
MarkMurphy / README.md
Last active March 25, 2022 21:47
ActiveRecord: Store Milliseconds (or Microseconds) in Timestamps with Rails / MySQL

ActiveRecord: Store Milliseconds (or Microseconds) in DateTimes or Timestamps with Rails / MySQL

Milliseconds in your DateTimes or Timestamps.

We got 'em, you want 'em.

NOTE: only MySQL 5.6.4 and above supports DATETIME's with more precision than a second. For reference see MySQL 5.6.4 Changelog

Why

Shit needs to be PRECISE

@burnash
burnash / imagemagick-install-steps
Last active March 27, 2019 12:00 — forked from rodleviton/imagemagick-install-steps
Installing Image Magick on Ubuntu 14.04
sudo -i
cd
apt-get install build-essential checkinstall -y
apt-get build-dep imagemagick -y
apt-get install libwebp-dev -y
wget http://www.imagemagick.org/download/ImageMagick-6.9.5-8.tar.gz
tar xzvf ImageMagick-6.9.5-8.tar.gz
cd ImageMagick-6.9.5-8/
./configure
make
@CMCDragonkai
CMCDragonkai / job_control_zsh_bash.md
Last active January 28, 2024 00:45
CLI: Job Control in ZSH and Bash

Job Control in ZSH and Bash

All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.

# run command in the foreground
command
# run commend in the background
@infusion
infusion / import-tar-gz.sh
Last active May 4, 2023 06:00
Import a tar.gz file to MySQL
tar xOf dump.sql.tar.gz | mysql -u $user -p $database
@honorlin
honorlin / gist:b34d1bba6514d74c24cf
Created August 8, 2015 10:37
Ubuntu Install Lastest ImageMagick-6.9.1-10
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
curl -O http://www.imagemagick.org/download/ImageMagick-6.9.1-10.tar.gz
tar xzvf ImageMagick-6.9.1-10.tar.gz
cd ImageMagick-6.9.1-10/
./configure --prefix=/opt/imagemagick-6.9.1-10 && make
checkinstall