Skip to content

Instantly share code, notes, and snippets.

View elliott-beach's full-sized avatar

Elliott Beach elliott-beach

  • Epic
  • Minnesota
View GitHub Profile
@elliott-beach
elliott-beach / screenshot.sh
Last active February 24, 2017 02:04
Get the most recent Screen Shot on OSX
# for convenience, get the most recent screen shot on osx
# might work for other OSs
screenshot=~/Desktop/$(ls -t ~/Desktop/ | grep "Screen Shot" | head -n 1)
# move it to currend working directory, and then do what you will.
mv "$screenshot" .
@elliott-beach
elliott-beach / heap.py
Last active February 8, 2017 16:06 — forked from showell/heap.py
heapsort in Python
def swap(a, i, j):
a[i], a[j] = a[j], a[i]
def heapify(a, n, max):
while True:
biggest = n
c1 = 2*n + 1
c2 = c1 + 1
for c in [c1, c2]:
if c < max and a[c] > a[biggest]:
@mikejolley
mikejolley / functions.php
Created July 2, 2016 13:21
WooCommerce - Redirect external products offsite (disable single listings)
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_action( 'template_redirect', 'redirect_external_products' );
function redirect_external_products() {
global $post;
@odan
odan / xampp_php7_xdebug.md
Last active June 28, 2024 12:58
Installing Xdebug for XAMPP
@williballenthin
williballenthin / commands.sh
Last active April 3, 2024 00:50
Install IDA Pro under Wine in Docker
# build wine Docker image
pushd wine; docker build -t wine .; popd
# build x11 Docker image for IDA
pushd ida; docker build -t wine/ida .; popd
# demonstrate x11 forwarding works
docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix wine/ida xclock
# interactive shell in container
@devknoll
devknoll / gist:8b274f1c5d05230bfade
Last active June 13, 2022 00:07
Basic GraphQL example using the GitHub API
import { graphql, GraphQLString, GraphQLInt } from 'graphql';
import { objectType, enumType, schemaFrom, listOf } from 'graphql-schema';
import request from 'promisingagent';
const repositorySortEnum = enumType('RepositorySort')
.value('CREATED', 'created')
.value('UPDATED', 'updated')
.value('PUSHED', 'pushed')
.value('FULL_NAME', 'full_name')
.end();
@itay-grudev
itay-grudev / rvm.fish
Last active March 23, 2022 13:31
Using RVM with Fish Shell in just 6 lines of code
# ~/.config/fish/functions/rvm.fish
function rvm --description "Ruby Version Manager"
exec bash --login -c "rvm $argv; exec fish" ^&1
end
@kurokikaze
kurokikaze / gist:350fe1713591641b3b42
Created October 3, 2014 11:40
install chrome from powershell
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec
@egel
egel / auto-remove-sublime-license-popup
Last active April 8, 2024 23:00
Auto-remove Sublime's license popup
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sublime_plugin
import subprocess
from time import sleep
import sys
cl = lambda line: subprocess.Popen(line, shell=True, stdout=subprocess.PIPE).communicate()[0].strip()
log = lambda message: sys.stderr.write("Log: %s\n" % message)
@rxaviers
rxaviers / gist:7360908
Last active July 3, 2024 07:16
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: