Enables any web page to become a rich object in a social graph.
-
Specs: https://ogp.me/.
-
Specs for sharing links: https://developers.facebook.com/docs/sharing/opengraph
// NodeJS based directory browsing and file serve without dependencies | |
// Joining code from <https://stackoverflow.com/questions/16333790/node-js-quick-file-server-static-files-over-http> | |
var fs = require("fs"), | |
http = require("http"); | |
http | |
.createServer(function (req, res) { | |
// Website you wish to allow to connect | |
res.setHeader("Access-Control-Allow-Origin", "*"); | |
Enables any web page to become a rich object in a social graph.
Specs: https://ogp.me/.
Specs for sharing links: https://developers.facebook.com/docs/sharing/opengraph
// <https://stackoverflow.com/a/4673436/2100126> | |
// First, checks if it isn't implemented yet. | |
if (!String.prototype.format) { | |
String.prototype.format = function() { | |
var args = arguments; | |
return this.replace(/{(\d+)}/g, function(match, number) { | |
return typeof args[number] != 'undefined' | |
? args[number] | |
: match | |
; |
javascript:(function(){f='https://typefully.com/?new='+encodeURIComponent(document.title)+'%250A'+encodeURIComponent(window.location.href);a=function(){if(!window.open(f))location.href=f};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})() |
// <https://dev.to/jorik/country-code-to-flag-emoji-a21> | |
function getFlagEmoji(countryCode) { | |
const codePoints = countryCode | |
.toUpperCase() | |
.split('') | |
.map(char => 127397 + char.charCodeAt()); | |
return String.fromCodePoint(...codePoints); | |
} |
const array = [1, 2, 3, 4, 5]; | |
array.groupBy((num, index, array) => { | |
return num % 2 === 0 ? 'even': 'odd'; | |
}); | |
// => { odd: [1, 3, 5], even: [2, 4] }> | |
const odd = { odd: true }; | |
const even = { even: true }; |
org = Organization.find(…) # <- Whatever magic do you use... | |
require 'stripe' | |
hackertime = Date.new(2021,11,1).to_time.to_i # <- It's just unix time, but it's the name front end guys do | |
Stripe.api_key = org.stripe_api_key # <- Your model should rock this way (auto region switch you known) | |
invoices = Stripe::Invoice.list({ "customer": org.stripe_customer_key, "created": { "gte": hackertime }}) |
You can clone the wiki of your github project via ssh:
git clone [email protected]:YOUR_USERNAME/YOUR_REPOSITORY.wiki.git
# From: | |
# https://www.danott.co/posts/seeding-development-with-test-fixtures/ | |
def load_fixtures | |
Rake::Task["db:fixtures:load"].invoke | |
end | |
load_fixtures |