Skip to content

Instantly share code, notes, and snippets.

View paulruescher's full-sized avatar

Paul Ruescher paulruescher

  • Rivian
  • Vancouver, BC
View GitHub Profile
#!/bin/bash
# backend/run
echo -n -e "\033]0;Rails\007"
foreman start
echo -n -e "\033]0;\007"
@paulruescher
paulruescher / Extend Recent Posts
Created June 26, 2012 19:02
Used this to change the output of WordPress' Recent Posts Widget
/**
* Extend Recent Posts Widget
*
* Adds different formatting to the default WordPress Recent Posts Widget
*/
Class My_Recent_Posts_Widget extends WP_Widget_Recent_Posts {
function widget($args, $instance) {
@paulruescher
paulruescher / spawner.ex
Created January 29, 2019 22:00
Spins up "concurrent" tasks
defmodule Spawner do
def process() do
receive do
after
1_000 ->
IO.puts "1 seconds elapsed"
for i <- 0..40, i > 0 do
Task.start(ModuleName, :func_name, [[key: value]])
end
int main()
{
    // Variable declaration
    int choice;
    // Print the main menu
    cout << "CMPT 126 - Assignment 1\n";
    cout << "\nPlease select one of the followings:\n";
    cout << "1\tQuadratic equation solver.\n";
    cout << "2\tReverse an integer and sum its digits.\n";
@paulruescher
paulruescher / gist:5224004
Created March 22, 2013 19:25
Twitter Feed
// Twitter Feed
add_shortcode( 'twitter', 'rl_twitter_feed' );
function rl_twitter_feed( $atts ) {
// Attributes
if( isset( $atts['handle'] ) )
$handle = $atts['handle'];
// Check transients
$body = get_transient( 'rl_twitter_data' );
@paulruescher
paulruescher / gist:5106618
Created March 7, 2013 09:04
Remove File From Git Repository
git rm --cached myFile.ext
@paulruescher
paulruescher / gist:5034090
Created February 25, 2013 22:54
Convert hexadecimal color to rgba
/**
* Converts hexidecimal to rgb format
*/
function lab_hex_to_rgb( $hex, $opacity = 1 ) {
$hex = str_replace( '#', '', $hex );
// if in 3 digit format
if( strlen( $hex ) == 3) {
@paulruescher
paulruescher / gist:5026277
Created February 24, 2013 23:43
Set Ember Data Adapter URL
App.Store = DS.Store.extend({
revision : 11,
adapter : DS.RESTAdapter.create({
url : 'https://proposals.firebaseio.com'
}),
});
@paulruescher
paulruescher / gist:4750980
Created February 10, 2013 20:40
Some SCSS that I'm using for setting up a circle class
$white : #FFF;
$off-white : #F7F7F7;
$light-grey : #EAEAEA;
$grey : #CCCCCC;
$darker-grey : #828282;
$dark-grey : #424242;
$off-black : #222;
$black : #000;
$light-blue : #45C6F0;
@paulruescher
paulruescher / Command Shortcuts
Last active December 12, 2015 08:09
Some useful Terminal commands
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + L Clears the Screen, similar to the clear command
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + H Same as backspace
Ctrl + R Let’s you search through previously used commands
Ctrl + C Kill whatever you are running
Ctrl + D Exit the current shell
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it.
Ctrl + W Delete the word before the cursor