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
heroku pgbackups:restore HEROKU_POSTGRESQL_<COLOR>_URL 'http://path.to.your.db' |
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
find . -name target -type d -exec ls -d {} \; |
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
module['exports'] = function httpReq(hook) { | |
// remove this on production, if you'd care | |
console.log(hook.params); | |
console.log(hook.req.path); | |
console.log(hook.req.method); | |
console.log(hook.env); | |
var request = require('request'); | |
var url = (hook.params.url)? decodeURI(hook.params.url) : null; |
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
> imagemagick-native@1.9.3 install /path/to/my/project/node_modules/imagemagick-native | |
> node-gyp rebuild | |
CXX(target) Release/obj.target/imagemagick/src/imagemagick.o | |
../src/imagemagick.cc:262:40: error: no member named 'FilterTypes' in namespace 'Magick' | |
image.filterType( (Magick::FilterTypes)option_info ); | |
~~~~~~~~^ | |
../src/imagemagick.cc:327:30: error: no matching constructor for initialization of 'Magick::Geometry' | |
Magick::Geometry resizeGeometry( resizewidth, resizeheight, 0, 0, 0, 0 ); | |
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
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
describe('test', () => { | |
it('should work', () => { | |
}); | |
} |
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
# view list of keys available on the system | |
gpg --list-secret-keys --keyid-format=long | |
# generate a new key (to be associated with a specific email address for which you'll be prompted) | |
gpg --full-generate-key # might differ depending on the gpg version being used | |
# echo pub key to the console | |
gpg -a --export your@email.example.com | |
# example use case: sign git commits with your gpg key |
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
import { renderHook } from '@testing-library/react-hooks' | |
import enableHooks, { withoutHooks } from 'jest-react-hooks-shallow' | |
// enable jest-react-hooks-shallow helper by default | |
enableHooks(jest) | |
describe('@testing-library/react-hooks renderHook and jest-react-hooks-shallow co-existence', () => { | |
it('testing-library `renderHook` does NOT work when jest-react-hooks-shallow helper is enabled', () => { | |
jest.spyOn(console, 'log'); |
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
pub fn main(name: &str) -> String { | |
let mut ret_val = String::from("xin chào, "); | |
ret_val.push_str(name); | |
println!("{}", ret_val); | |
ret_val | |
} | |
// normally `main` isn't supposed to return `String` type | |
// but this is done on purpose here to support a specially intended use case |
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
use std::env; | |
pub fn main() { | |
let args: Vec<String> = env::args().collect(); | |
let mut ret_val = String::from("hello, "); | |
ret_val.push_str(&args[1]); | |
ret_val.push_str("\n"); | |
ret_val.push_str("try calling me like https://fd96bd80a0d79fe3831f67a461d064b6.run.zzzz.dev/mommy"); | |
println!("{}", ret_val); | |
} |
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
import sys | |
import os | |
print("I love ya") |
OlderNewer