Skip to content

Instantly share code, notes, and snippets.

View jrm2k6's full-sized avatar

Jeremy Dagorn jrm2k6

View GitHub Profile
@jrm2k6
jrm2k6 / res.json
Created April 4, 2019 23:23
Predictions for input: 2234 Brant Street San Diego
[
{
"description": "2234 Brant Street, San Diego, CA, USA",
"id": "9e4be32037a103ef7668e65330a6200518e59c42",
"matched_substrings": [
{
"length": 4,
"offset": 0
},
{
'use strict';
module.exports = {
up: function(queryInterface, Sequelize) {
return queryInterface.createTable('pictures', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
<?php namespace Testing\Traits;
trait DatabaseTruncate
{
/**
* Define hooks to truncate the database before each test.
*
* @return void
*/
public function runTruncateDatabase()
$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');
setInterval(function() { Array.prototype.slice.call(document.querySelectorAll('[data-reactid]')).forEach(function(element) { element.style.background = 'rgba(255,0,0,0.1)'; }) }, 500)
<?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 {

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.

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>'
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
(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;