Skip to content

Instantly share code, notes, and snippets.

@OlegIlyenko
OlegIlyenko / DateType.scala
Created August 19, 2015 08:23
GraphQL scalar DateType implemented with sangria
case object DateCoercionViolation extends ValueCoercionViolation("Date value expected")
def parseDate(s: String) = Try(new DateTime(s, DateTimeZone.UTC)) match {
case Success(date) => Right(date)
case Failure(_) => Left(DateCoercionViolation)
}
val DateTimeType = ScalarType[DateTime]("DateTime",
coerceOutput = date => ast.StringValue(ISODateTimeFormat.dateTime().print(date)),
coerceUserInput = {
@jerhinesmith
jerhinesmith / download.rb
Created August 14, 2015 16:23
Grab all NBA team logos
#!/usr/bin/env ruby
require 'open-uri'
teams = {
atl: 'hawks',
bkn: 'nets',
bos: 'celtics',
cha: 'hornets',
chi: 'bulls',
@vitorbritto
vitorbritto / rm_mysql.md
Last active April 23, 2024 14:21
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@nl5887
nl5887 / transfer.fish
Last active March 22, 2022 09:07
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@diegopacheco
diegopacheco / FRP.md
Last active August 8, 2017 12:26
Functional Reactive Streams | FRP | Akka | Streams
@sebmarkbage
sebmarkbage / react_legacyfactory.md
Last active March 15, 2020 00:32
Use a factory or JSX

React Element Factories and JSX

You probably came here because your code is calling your component as a plain function call. This is now deprecated:

var MyComponent = require('MyComponent');

function render() {
 return MyComponent({ foo: 'bar' }); // WARNING
@gphat
gphat / gist:c9d22e1c0d3e0d2546d1
Created August 15, 2014 21:50
Cassandra Datadog JMX Config
instances:
- host: localhost
port: 7199
# user: username
# password: password
# name: cassandra_instance
# #trust_store_path: /path/to/trustStore.jks # Optional, should be set if ssl is enabled
# #trust_store_password: password
# #java_bin_path: /path/to/java #Optional, should be set if the agent cannot find your java executable
@airawat
airawat / 00-OozieConfigSSHAction
Last active January 8, 2020 02:41
Oozie configuration for SSH action
# The following documentation details configuring an application ID to execute a SSH action
# In the illustration-
# edge node=cdh-sn03
# oozie server=cdh-mn01
# applicaiton ID=akhanolk
# ==========================================
# 1. On edge node, as application ID
@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@rtt
rtt / tinder-api-documentation.md
Last active April 20, 2024 17:01
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)