Skip to content

Instantly share code, notes, and snippets.

View heyalexej's full-sized avatar

Alexej heyalexej

  • rather hard to pin down
View GitHub Profile
rand = (max =10, min = 0) ->
Math.floor(Math.random() * (max - min + 1)) + min
console.log rand()
console.log rand 100
console.log 50, 10
@heyalexej
heyalexej / site-sucker.sh
Last active January 6, 2021 16:05
Helps you to download a WordPress (and other sites) from the command line and reuse as static HTML.
wget --html-extension --recursive --page-requisites --convert-links --mirror --user-agent="Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)" http://www.yourdomain.com
<script src="https://checkout.stripe.com/checkout.js"></script>
<button id="btn2" class="btn btn-success btn-lg btn-block">
<span class="text-uppercase"><span class="text-white-dark">Buy now for</span> $<%= "#{settings.price2}" %></span>
</button>
<script>
var handler = StripeCheckout.configure({
preferred_syntax = :sass
http_path = '/'
css_dir = 'assets/stylesheets'
sass_dir = 'assets/sass'
images_dir = 'assets/images'
javascripts_dir = 'assets/javascripts'
relative_assets = true
line_comments = true
# output_style = :compressed
@heyalexej
heyalexej / bootstrap.scss
Created February 2, 2014 10:24
Bootstrap Components
// Core variables and mixins
@import "variables";
@import "mixins";
// Reset
@import "normalize";
@import "print";
// Core CSS
@import "scaffolding";
@heyalexej
heyalexej / app.rb
Created February 3, 2014 23:11 — forked from dansimco/app.rb
Concise Sinatra Amazon S3 Upload Example (w/o Cloudfront)
require "rubygems"
require 'sinatra'
require "aws/s3"
get '/' do
return %Q{
<form action="upload" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<div>
<input type="file" name="file" value="" id="file">
</div>
@heyalexej
heyalexej / filesfromlist.sh
Created February 7, 2014 15:39
Create file names from input file.
while read line; do touch $(echo -n "$line").myfilextension; done < input.csv
@heyalexej
heyalexej / batchdownloadhashrename.sh
Created February 12, 2014 22:57
Dirtiest Download Script in the World!
#!/bin/bash
# check for directories and create if non-existent.
for i in lala lulu
do
if [ -d $i ]; then
echo "Cool. Directory $i exists."
else
echo "Directory $i didn't exist so I knitted one for ya!"
mkdir $i
@heyalexej
heyalexej / statuscodes.sh
Created February 19, 2014 12:28
Check status codes for a list of URLs
while read LINE; do curl -o /dev/null --head --silent --write-out "$LINE\t %{http_code}\n" "$LINE"; done < inputfile 2>&1 | tee outputfile

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a