Skip to content

Instantly share code, notes, and snippets.

Avatar

Eloy Durán alloy

View GitHub Profile
@sibelius
sibelius / richTextToRelayRecordProxy.tsx
Created Sep 17, 2020
Transform an object to a Relay Record Proxy
View richTextToRelayRecordProxy.tsx
export const richTextToRelayRecordProxy = (bodyRichText, store) => {
const bodyRichTextId = 'client:RichText:' + tempID++;
const bodyRichTextRecord = store.create(bodyRichTextId, 'RichText');
bodyRichTextRecord.setValue(bodyRichText.text, 'text');
bodyRichTextRecord.setValue(bodyRichText.html, 'html');
const { contentState } = bodyRichText;
if (contentState) {
const contentStateId = 'client:DraftContentState:' + tempID++;
@dnkoutso
dnkoutso / local_dependencies_source.rb
Created Mar 20, 2020
A CocoaPods source that discovers podspecs locally.
View local_dependencies_source.rb
module Pod
class LocalDependenciesSource < Source
attr_reader :sandbox
attr_reader :local_podspecs_by_name
def self.register(plugin_name, sandbox, local_podspec_dependencies)
return unless local_podspec_dependencies
# Register a source that can be used to provide local podspecs
HooksManager.register(plugin_name, :source_provider) do |context|
@HiImJulien
HiImJulien / Swift Meets CCxx.md
Last active Oct 12, 2020
This gist is a simple example on how to call a function written in swift from C/C++, without taking the detour via Objective-C/C++.
View Swift Meets CCxx.md

Swift Meets C/C++

This gist is a simple example on how to call a function written in swift from C/C++, without taking the detour via Objective-C/C++.


Analytics

In this example we're going to invoke a function called say_hello, which, as the name already suggests, prints "Hello, World!" to the terminal.

View load.cr
require "./src/sidekiq"
`redis-cli flushdb`
class LoadWorker
include Sidekiq::Worker
perform_types Int64
def perform(idx)
end
View rtr-docker.md

Rent The Runway - Docker D&D

Related blog post:

http://artsy.github.io/blog/2015/12/09/docker-for-development/

Reasons for using docker:

  • new developers have a setup that works without installing and configuring MongoDB, Solr, Elasticsearch, memcached, etc.
  • a docker-compose.yml file can provide the related services and environment variables an application needs.
View symbolicate.js
// Copyright 2004-present Facebook. All Rights Reserved.
'use strict';
var SourceMapConsumer = require('source-map').SourceMapConsumer;
var fs = require('fs');
var argv = process.argv.slice(2);
if (argv.length < 2) {
console.error('Usage: ' + __filename + ' <source-map-file> <lineNumber> [column]');
process.exit(1);
View sort_imports
#!/usr/bin/env ruby
require 'pathname'
code_files = ARGV
code_files.each do |file|
file = Pathname(file)
contents = file.read
contents.gsub!(/(^#import .*\n)+/) do |imports|
imports = imports.split("\n")
imports.sort.uniq.join("\n") << "\n"
@neonichu
neonichu / bump_xcode_plugin.sh
Created Mar 12, 2015
Quickly bump the compatibility UUID of a plugin in the CWD to the one of the currently selected Xcode.
View bump_xcode_plugin.sh
#!/bin/sh
PLIST_BUDDY=/usr/libexec/PlistBuddy
function add_id {
"$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $1" "$2"
}
function has_id {
read_id DVTPlugInCompatibilityUUIDs *Info.plist|grep -q "$1"
@dougireton
dougireton / recruiter_response.md
Last active Jan 11, 2020
I've started responding to recruiters with this list of requirements
View recruiter_response.md

Company Requirements

I'm definitely not looking for work. However to provide some helpful guidance for hiring like-minded engineers, I would only consider working for a company if it met these requirements:

  1. Fewer than 250 employees.
  2. Concrete, measurable plan to increase the number of women and minorities in engineering roles.
  3. Commitment to using and contributing to open source.
  4. Collaborative, friendly atmosphere where pair programming is encouraged.
  5. Meaningful work with clear linkage between work and company goals.
  6. Demonstrated commitment to ethical business practices, e.g. B corp certification.
View .kick.rb
require 'socket'
require 'tempfile'
require 'digest/md5'
require 'benchmark'
recipe :ignore
class Kicker
module Recipes
module Spin
You can’t perform that action at this time.