This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
original = "const logger = require('../lib/logger');" | |
replacement = "const { Logger } = require('@neatcapital/logger');\nconst logger = new Logger(__filename);" | |
Dir.glob('./config/*.js') do |filename| | |
text = File.read(filename) | |
text.gsub!(original, replacement) | |
File.open(filename, 'w') { |file| file.puts text } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('button.js-add-kudo').forEach(node => node.click()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'sinatra' | |
class App < Sinatra::Base | |
get '/event' do | |
hub_challenge = params['hub.challenge'] | |
content_type :json | |
{ 'hub.challenge' => hub_challenge }.to_json | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'sinatra' | |
group :development do | |
gem 'sinatra-contrib' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { is, fromJS } = require('immutable') | |
const nested = fromJS({ a: { b: { c: [ 3, 4, 5 ] } } }) | |
const nestedWithoutImmutable = nested.setIn(['a', 'b', 'c'], 'foo') | |
const nestedWithImmutable = nested.setIn(['a', 'b', 'c'], fromJS('foo')) | |
console.log("Is it equal? " + is(nestedWithoutImmutable, nestedWithImmutable)); | |
console.log("\nWithout immutable setter\n" + nestedWithoutImmutable); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Allows yank to copy to clipboard | |
set cb=unnamed | |
" Allows pasting from clipboard | |
set cb=unnamedplus | |
" Allows selecting text and using CMD+c | |
set mouse= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dir.glob('app/admin/*.rb') do |file_name| | |
File.open(file_name, "r") do |f| | |
text = File.read(f) | |
form_matches = text.match(/form do \|(?<block_param>\w+)\|/) | |
if form_matches && form_matches[:block_param] | |
semantic_errors_matches = text.match(/#{form_matches[:block_param]}.semantic_errors\(\*f\.object\.errors\.keys\)/) | |
if !semantic_errors_matches |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule CitrusByte do | |
@moduledoc """ | |
Provides the `flatten/1` function to flatten a List | |
""" | |
@doc """ | |
Flattens a List | |
## Examples |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _this = this; | |
items.map(function(item) { | |
return _this.massageSomething(item); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "date": "Aug 23", "count": 2343 }, | |
{ "date": "Aug 24", "count": 4545 }, | |
{ "date": "Aug 25", "count": 7342 }, | |
{ "date": "Aug 26", "count": 994 }, | |
{ "date": "Aug 27", "count": 1500 }, | |
{ "date": "Aug 28", "count": 4234 }, | |
{ "date": "Aug 29", "count": 7233 }, | |
{ "date": "Aug 30", "count": 2233 }, | |
{ "date": "Aug 31", "count": 100 } |
NewerOlder