Skip to content

Instantly share code, notes, and snippets.

View waissbluth's full-sized avatar

Nicolas Waissbluth waissbluth

View GitHub Profile
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@peterwake
peterwake / RGeo_with_Proj.md
Last active March 22, 2021 08:34
Installation of RGeo with Proj support (also called Proj4)

Installation of RGeo with Proj support (also called Proj4)

This is a real pain as of writing (18 Oct 2019). I can't promise it'll work either :)

Reference

Let's start from the beginning...

If you've been hacking around already you should do:

@ssaunier
ssaunier / sidekiq.config
Created September 24, 2015 09:30
Running Sidekiq on AWS Elastic Beanstalk (Put that file in `.ebextensions` folder)
# Sidekiq interaction and startup script
commands:
create_post_dir:
command: "mkdir -p /opt/elasticbeanstalk/hooks/appdeploy/post"
ignoreErrors: true
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh":
mode: "000755"
owner: root
group: root
from __future__ import absolute_import
from __future__ import print_function
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.utils import np_utils
from scipy.special import expit
import numpy as np
np.set_printoptions(suppress=True)
@MobiDevelop
MobiDevelop / tileset.scm
Last active March 21, 2021 09:48
GIMP script to add margin adn spacing to a tilsheet
(define (script-fu-respace-tiles-addMarginSpacing inImage inLayer tileSize)
(let* (
(margin 1)
(spacing 2)
(duplicatePadding TRUE)
(theWidth (car (gimp-drawable-width inLayer)))
(theHeight (car (gimp-drawable-height inLayer)))
(theMarginX (* 2 margin))
(theMarginY (* 2 margin))
@edelpero
edelpero / heroku_rails_phantomjs.md
Last active May 10, 2021 08:31
Heroku, Ruby on Rails and PhantomJS

#Heroku, Ruby on Rails and PhantomJS

In this post, I’m going to show you how to modify an existing Ruby on Rails app running on Heroku’s Cedar stack to use PhantomJS for screen scraping. If you’ve never heard of PhantomJS, it’s a command-line WebKit-based browser (that supports JavaScript, cookies, etc.).

Let’s get started. This is a high-level overview of the required steps:

  • Modify your app to use multiple Heroku buildpacks.
  • Extend your app to use both the Ruby as well as the PhantomJS buildpacks.
  • Confirm that everything worked.
@vasrap
vasrap / mercator-latlon-to-meters.rb
Last active March 15, 2021 15:54
Lat/Lon to Meters using Mercator projection
puts "Enter latitude in decimal degrees:"
lat_deg = gets.to_f
puts "Enter longitude in decimal degrees:"
lon_deg = gets.to_f
lon_rad = (lon_deg / 180.0 * Math::PI)
lat_rad = (lat_deg / 180.0 * Math::PI)
sm_a = 6378137.0
x = sm_a * lon_rad
y = sm_a * Math.log((Math.sin(lat_rad) + 1) / Math.cos(lat_rad))
@lukencode
lukencode / widget.js
Last active December 7, 2021 19:16
Starter template for creating jsonp embeddable widgets.
(function () {
var scriptName = "embed.js"; //name of this script, used to get reference to own tag
var jQuery; //noconflict reference to jquery
var jqueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js";
var jqueryVersion = "1.8.3";
var scriptTag; //reference to the html script tag
/******** Get reference to self (scriptTag) *********/
var allScripts = document.getElementsByTagName('script');
@daveaugustine
daveaugustine / Inside_your_router.coffee
Created February 8, 2012 18:33
Super simple Google Analytics page tracking with backbone
initialize: ->
@bind 'all', @_trackPageview
_trackPageview: ->
url = Backbone.history.getFragment()
_gaq.push(['_trackPageview', "/#{url}"])