This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# here's a good blog post on Refinements => https://blog.codeship.com/ruby-refinements/ | |
# here's some Ruby documentation on Refinements => https://ruby-doc.org/core-2.1.1/doc/syntax/refinements_rdoc.html | |
class Foo < Struct.new(:bar) | |
end | |
module FooTools | |
refine Foo do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Determine which environment you'd like to copy | |
- Fork that environment's repo on Gitlab | |
- Clone that environment's repo to deploy server | |
$ deploy_server_ssh () | |
{ | |
ssh -A <your username>@sig-swippoc02.internal.synopsys.com | |
} | |
$ deploy_server_ssh | |
$ cd /deploy/repos |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env elixir | |
defmodule MailboxBenchmark do | |
def start_link(messages) do | |
count = Enum.at(messages, -1) | |
pid = spawn_link(fn -> blocked(count) end) | |
_ = Enum.each(messages, fn (i) -> send(pid, i) end) | |
{:ok, pid} | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iomanip> | |
using namespace std; | |
int main () { | |
double a = 0.1; | |
double b = 0.2; | |
double result = a + b; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Size at the end is * 2048 where 2048 = 1 MB, so 1572864 = 768 MB | |
#DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://1572864` | |
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://2097152` | |
/usr/sbin/diskutil erasevolume HFS+ "RamDiskCache" $DISK | |
CACHEDIR="/Volumes/RamDiskCache/$USER" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Couldn't find a pure Bash utility for UUIDs, so I wrote this for fun (it ain't fast) | |
base_36_char () { | |
( | |
HIGH=${1:-15} | |
LOW=${2:-0} | |
RAND_NUM=$RANDOM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# iex(80)> {:ok, _} = Test_1.start_child(:foo) | |
# {:ok, #PID<0.1214.0>} | |
# iex(81)> Stack.push(:foo, :hello) | |
# :ok | |
# iex(82)> Stack.push(:foo, :hello) | |
# :ok | |
# iex(83)> Stack.pop(:foo) | |
# :hello | |
# iex(84)> Stack.pop(:foo) | |
# :hello |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Counter do | |
use GenServer | |
# Client | |
def decrement(pid) do | |
GenServer.call(pid, :decrement) | |
end | |
def count(pid) when is_pid(pid) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
algotirhm: | |
- a set of steps (for a computer program) to accomplish a task | |
data structure: | |
- a way of organizing data that considers not only the items stored, but also their relationship to each other. |
NewerOlder