{
type: 'element',
tagName: 'div',
properties: {className: ['foo'], id: 'some-id'},
children: [
{
type: 'element',
This file contains 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
class Object | |
def pt(next_step) | |
case next_step | |
when Symbol | |
Kernel.send(next_step, self) | |
when String | |
method_name, *args = next_step.split(/[()]/).reject(&:empty?) | |
Kernel.send(method_name, self, *args) | |
else | |
raise TypeError, "Unsupported type for piping. Use Symbol for methods or String for methods with args." |
This file contains 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/ruby | |
module FunctionOverloading | |
def self.included(base) | |
base.extend(ClassMethods) | |
base.instance_variable_set(:@overloaded_methods, {}) | |
end | |
module ClassMethods | |
def method_added(name) |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
This file contains 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 Year do | |
@typedoc """ | |
A 4 digit year, e.g. 1984 | |
""" | |
@type cType :: {integer, String.t} | |
@type year :: integer | |
@spec current_age(year) :: cType | |
When you sit down and start a new project, often times, you'll want to set up a virtual host,
a spoof domain that will emulate a live environment. The effort is usually two parts: set up a
domain in /etc/hosts
, and then add a <VirtualHost>
entry in /Applications/MAMP/conf/apache/httpd.conf
to make your files accessible.
This tutorial is setting up a 'zero-configuration' development environment. We'll be setting up a
spoof domain ending in .dev
. In MAMP, we'll create a folder called dev
. Any folder inside,
the name will become the domain.
This file contains 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 <string> | |
#include <cmath> | |
using namespace std; | |
int main() { | |
int userDay = 0; | |
int userYear = 0; | |
int userMonth = 0; |
This file contains 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
import <iostream> | |
import 'X' | |
import 'ioX' | |
import 'etc' | |
using namespace std | |
int main() | |
{ | |
define _X_ =x::title | |
var = login_details; | |
string = x_entered_login_details; |