Author: | Charles Childers |
---|---|
Date: | September 12, 2010 |
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
with quotes' | |
( compare two strings from the beginning and return how many ) | |
( similar characters there are before the strings diverge. ) | |
: ^match ( $$-n ) | |
0 -rot repeat @+ [ swap @+ ] dip =if rot 1+ -rot else 2drop ;then again ; | |
( test each word in the dictionary for similarity. if similar up ) | |
( to the current point, add to the suggestions queue. ) | |
create list here , 100 allot |
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
def method(grid,root,rev = false) | |
grid.send(rev ? :reverse_each : :each) do |row| | |
row.send(rev ? :<< : :unshift, @num) | |
@num += 1 | |
end | |
new_row = [] | |
root.times do | |
new_row.send(rev ? :unshift : :<<, @num) | |
@num += 1 |
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
# | |
# Regular Expression for URL validation | |
# | |
# Converted Diego Perini's regexp to ruby | |
# | |
# Author: James Robey | |
# Updated: 2013/02/07 | |
# | |
# Credits to Matt (mparodi) | |
# |
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 UserSerializer < ActiveModel::Serializer | |
attributes :id, :name, :phone, :email, :balance, :children, :balance | |
def attributes | |
data = super | |
data[:children] = User.find(data[:id]).subordinates.any? | |
data | |
end | |
end |
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
var RiotControl = { | |
_stores: [], | |
addStore: function(store) { | |
this._stores.push(store); | |
} | |
}; | |
['on','one','off','trigger'].forEach(function(api){ | |
RiotControl[api] = function() { | |
var args = [].slice.call(arguments); |
- define grid container element (parent) ->
display: grid
- set its column and row sizes ->
grid-template-columns
andgrid-template-rows
- place grid items (children) into the grid ->
grid-column
andgrid-row
- children are only the direct descendants of the parent element
- Note: column, float, clear, and vertical-align have no effect on a grid container.
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
(* | |
Export All Safari Tabs in All Open Windows to a Markdown File | |
July 13, 2015 | |
// SCRIPT PAGE | |
http://hegde.me/urlsafari | |
// ORIGINAL SCRIPT ON WHICH THIS SCRIPT IS BUILT | |
http://veritrope.com/code/export-all-safari-tabs-to-a-text-file |
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 Expng do | |
defstruct [:width, :height, :bit_depth, :color_type, :compression, :filter, :interlace, :chunks] | |
def png_parse(<< | |
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, | |
_length :: size(32), | |
"IHDR", | |
width :: size(32), | |
height :: size(32), |