Skip to content

Instantly share code, notes, and snippets.

🤖
automated

Alejandro AR kinduff

🤖
automated
Block or report user

Report or block kinduff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kinduff
kinduff / package.json
Last active May 23, 2019
Social Image
View package.json
{
"name": "social-image",
"version": "1.0.0",
"description": "Creates a dynamic social image for Kinduff's blog posts",
"main": "social-image.js",
"scripts": {
"test": "echo \"What a shame! No test specified\" && exit 1"
},
"author": "Alejandro AR <kinduff>",
"license": "MIT",
View gist:a0a9aeeff36b05a5eed85a1e3a558a50
Add the base code to any page where you want to track conversions. If you want to use retargeting, add this code to every page of your site to create audiences to retarget later.
Be sure to put the base code between the <head> and </head> tags in your HTML document. It should only appear once on a single page, and before the subsequent event code.
Use Enhanced Match to get improved visibility into your conversion data—passing back email data on a conversion lets us better attribute it to an event on Pinterest. To use Enhanced Match, pass back the converting user’s email (or the SHA256 hash of their email) in the em parameter highlighted in blue. For more detailed instructions, visit our help center.
<!-- Pinterest Tag -->
<script>
!function(e){if(!window.pintrk){window.pintrk = function () {
window.pintrk.queue.push(Array.prototype.slice.call(arguments))};var
n=window.pintrk;n.queue=[],n.version="3.0";var
t=document.createElement("script");t.async=!0,t.src=e;var
r=document.getElementsByTagNa
View HN_sort_by_votes.js
javascript:(function()%7B'use%20strict'%3B%2F%2F%20This%20let%20statement%20selects%20elements%20from%20the%20HTML%20document%20using%20a%20CSS%20selector.%2F%2F%20Specifically%2C%20we're%20making%20an%20Array%20of%20all%20table%20rows%20(each%20news%20listing%20is%2F%2F%20a%20table%20row%20in%20an%20html%20table).%20The%20css%20selector%20here%20says%2C%20find%20the%20'tr'%20elements%2F%2F%20that%20are%20nested%20at%20any%20depth%20below%20a%20tbody%20which%20is%20nested%20at%20any%20depth%20below%20any%2F%2F%20element%20bearing%20the%20class%20'itemlist'%20--%20the%20dot%20in%20front%20of%20itemlist%20indicates%2F%2F%20we're%20talking%20about%20a%20CSS%20class%2C%20not%20an%20element.%2F%2F%20Look%20up%20css%20selectors%20and%20the%20document.querySelectorAll%2F%2F%20function%20for%20more%20about%20that.%2F%2F%20When%20you%20do%20a%20querySelectorAll%2C%20you%20get%20a%20NodeList%20in%20return%2C%20not%20quite%20the%20same%2F%2F%20thing%20as%20an%20array%2C%20because%20you%20can't%20slice%20it.%20Well%2C%20
View keybase.md

Keybase proof

I hereby claim:

  • I am kinduff on github.
  • I am kinduff (https://keybase.io/kinduff) on keybase.
  • I have a public key whose fingerprint is AE52 2EFE 9214 C2DE D5B0 FB33 6592 95DE E5B8 4DAD

To claim this, I am signing this object:

View json_parse.sh
# Using JSON.sh as a JSON parser
# Download https://github.com/dominictarr/JSON.sh
function jsonGetValue {
./JSON.sh | grep -F -e $1 | cut -f2 | tr -d '"'
}
# Usage
read -r -d '' JSON_DATA <<'EOF'
{
View insertion_sort.rb
def sort(values)
length = values.size - 1
1.upto(length) do |i|
temp = values[i]
j = i - 1
while j >= 0 and values[j] > temp
values[j+1] = values[j]
j -= 1
View bubble_sort.rb
def sort(values)
length = values.size - 2
swapped = true
while swapped
swapped = false
0.upto(length) do |i|
if values[i] > values[i+1]
values[i], values[i+1] = values[i+1], values[i]
View binary_search.rb
def findIndex(values, target)
binarySearch(values, target, 0, values.size - 1)
end
def binarySearch(values, target, start, finish)
return -1 if start > finish
middle = ((start+finish)/2).floor
value = values[middle]
View hash_table_linked_list.rb
class LinkedList
#...
end
class Node
#...
end
class HashTable
def initialize(size)
View linked_list_removeAt.rb
def removeAt(index)
prev = nil
node = @head
i = 0
loop do
prev = node
node = node.next
i += 1
break unless !node.nil? and i < index
end
You can’t perform that action at this time.