Skip to content

Instantly share code, notes, and snippets.

🤡
Will be notified of any issues opened on cloudder/react-markdown-editor!

Jeremy Dagorn jrm2k6

🤡
Will be notified of any issues opened on cloudder/react-markdown-editor!
Block or report user

Report or block jrm2k6

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jrm2k6
jrm2k6 / res.json
Created Apr 4, 2019
Predictions for input: 2234 Brant Street San Diego
View res.json
[
{
"description": "2234 Brant Street, San Diego, CA, USA",
"id": "9e4be32037a103ef7668e65330a6200518e59c42",
"matched_substrings": [
{
"length": 4,
"offset": 0
},
{
View migration-picture.js
'use strict';
module.exports = {
up: function(queryInterface, Sequelize) {
return queryInterface.createTable('pictures', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
View DatabaseTruncate.php
<?php namespace Testing\Traits;
trait DatabaseTruncate
{
/**
* Define hooks to truncate the database before each test.
*
* @return void
*/
public function runTruncateDatabase()
View gist:7ba267d06823fe00a29d
$client = new \GuzzleHttp\Client();
$img = $client->get('http://talkingshrimp.com/ts/wp-content/uploads/2009/11/I-dunno-lol11.jpg');
$img = Image::make($img->getBody()->getContents());
header("Content-type: image/jpeg");
echo $img->response('jpg');
View poweredbyreact.js
setInterval(function() { Array.prototype.slice.call(document.querySelectorAll('[data-reactid]')).forEach(function(element) { element.style.background = 'rgba(255,0,0,0.1)'; }) }, 500)
View gist:8537e5e883775cf73392
<?php
use Dingo\Api\Auth\Provider;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Tappleby\AuthToken\AuthTokenManager;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
class AuthTokenAuthenticationProvider extends Provider {
View gist:6997240c291694f5d3e5

Publishing your first npm module, from top to bottom.

Great, you have some cool code that you use for your project, and you wish everybody could see how cool you are, and how clean your code is. Lucky guy, your code can totally be extracted to a small module in javascript, perfect occasion to publish your first npm module. Your code is ready, time to package, publish and enjoy.

###Creating your user

Assuming you have npm installed of course, run npm adduser.

You will have to enter a username, name and email address. You can also sign up directly on the website.

View gist:9f84715781be76562672
Building native extensions. This could take a while...
ERROR: Error installing travis:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:4:in `<main>'
View gist:394f297bf8659c6d0ffe
app = Flask(__name__)
assets = Environment(app)
Markdown(app, extensions=['codehilite'])
app.config.from_object(__name__)
app.config.from_object('publishr.config')
app.secret_key = 'this is my secret key'
global posts_exporter_instance
View gist:430c08a0c53701914511
(env)jrm2k6 @ 08:10:07 : ~/Workspace/mozillians (master) $./manage.py test
nosetests --verbosity=1
Creating test database for alias 'default'...
Got an error creating the test database: (1044, "Access denied for user 'mozillians'@'localhost' to database 'test_mozillians'")
Type 'yes' if you would like to try deleting the test database 'test_mozillians', or 'no' to cancel: yes
Destroying old test database 'default'...
Got an error recreating the test database: (1044, "Access denied for user 'mozillians'@'localhost' to database 'test_mozillians'")
mysql> select user,host from mysql.user;
You can’t perform that action at this time.