Skip to content

Instantly share code, notes, and snippets.

View skopp's full-sized avatar

Rashaad Essop skopp

View GitHub Profile
@skopp
skopp / diffbot
Last active December 17, 2015 23:09
diffbot dev customizing - this is in HAML, just saved without the extension (Gists don't allow subdirs apparently)
!!!
%html{:lang => "en"}
%head
%meta{:charset => "utf-8"}/
%title Customize Instructions
%meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}/
/ Default styles
%link{:href => "/dev/css/bootstrap.min.css", :rel => "stylesheet"}/
%link{:href => "/dev/css/fonts.css", :rel => "stylesheet"}/
%link{:href => "/dev/css/default.css", :rel => "stylesheet"}/
Markdown Syntax Guide
=====================
This is an overview of Markdown's syntax. For more information, visit the [Markdown web site].
[Markdown web site]:
http://daringfireball.net/projects/markdown/
# html2markdown.rb
require 'nokogiri'
module Html2Markdown
class HtmlDocument < Nokogiri::XML::SAX::Document
MAP = { "b" => "strong", "i" => "em" }
def initialize()
@list = nil
pairwise = (arr) ->
arr.map (item, index, _arr) ->
_arr.map((_item) ->
[item, _item] unless item is _item
).filter Boolean

My Modular CSS.

A refresher on how I write CSS. I prefer the style of modular CSS (ala Twitter Bootstrap / SMACSS ).

Current Naming Convention.

Below is an example of the suggested module / sub module naming convention:

/* Button Parent */
.button {...}
@skopp
skopp / LICENSE.txt
Last active December 17, 2015 19:39 — forked from 140bytes/LICENSE.txt
140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Since Git is well structured, Grit uses a method missing (Grit::Git#method_missing) to 'systematically' execute Git commands:
require 'grit'
include Grit
gritty = Grit::Git.new('/tmp/filling-in')
gritty.clone({:quiet => false, :verbose => true, :progress => true, :branch => '37s'}, "git://github.com/cookbooks/cc-aws.git", "/tmp/cc-aws2")
# => "Initialized empty Git repository in /tmp/cc-aws2/.git/\n"
Dir.entries('/tmp/cc-aws2').size
# => 10
#!/usr/bin/python
# Make sure file permission is set so that Owner, Group, and Everyone can EXECUTE.
# Otherwise server error
import os
import platform
print "Content-Type: text/html"
print

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@skopp
skopp / bare.haml
Created May 14, 2013 18:33
git bare vs non-bare repos
!!!
%html{:lang => "en"}
%head
%title Git bare vs. non-bare repositories
%meta{:charset => "utf-8"}/
%meta{:content => "git, mercurial, push, pull, revision control, repository, repositories, cvs, remote repository", :name => "keywords"}/
%meta{:content => "The Git revision control system has something called a bare and a non-bare repository. This article deals with the issue and also compares the Git design to the design of Mercurial and Bazaar.", :name => "description"}/
%link{:href => "/themes/bitflop/stylesheet.css", :media => "screen", :rel => "stylesheet", :type => "text/css"}/
%link{:href => "/rss.php", :rel => "alternate", :type => "application/rss+xml"}/
%body{:onload => "sh_highlightDocument();"}