Skip to content

Instantly share code, notes, and snippets.

View AdrienGiboire's full-sized avatar
🥦
Plant-fueled, you can't test me!

Adrien AdrienGiboire

🥦
Plant-fueled, you can't test me!
View GitHub Profile
** Invoke bundler:install (first_time)
** Invoke bundler:config (first_time)
** Execute bundler:config
01:32 bundler:config
01 $HOME/.rbenv/bin/rbenv exec bundle config --local deployment true
✔ 01 user@server.tld 0.968s
02 $HOME/.rbenv/bin/rbenv exec bundle config --local path /path/to/project/shared/bundle
✔ 02 user@server.tld 0.874s
03 $HOME/.rbenv/bin/rbenv exec bundle config --local without development:test
✔ 03 user@server.tld 1.099s
@AdrienGiboire
AdrienGiboire / journeys.rb
Last active October 29, 2019 12:31
Journeys
class Robot
MOVES = {
L: 'move_left',
R: 'move_right',
F: 'move_forward'
}
DIRECTIONS = ['N', 'E', 'S', 'W']
def initialize position
<?php
define('API_ACCESS_KEY', 'AIzaSyA18itgZWVpD0zJ9ynRFHkVlpEIVRhzQGw');
$to = 'dZ0oX5R8nU4:APA91bHDLDsBZk7P76bRqNkiwWEhksd58QywCy2c0v-8HPuuwLN4SHdkFE5CMmgk5N-kzvGzWvxUafAlgDVnNagc9ZJf0BAxrdhmbScbsYojEEg5T750FPfne6VkA0rkD3Ix8jJbwtON';
$notification = array
(
'body' => 'here is a message. message',
'title' => 'This is a title. title',
'sound' => 1
);
$data = array
task 'assets:precompile:before' do
require 'uglifier'
require 'sprockets'
require 'term/ansicolor'
include Term::ANSIColor
unless %w{production}.include? Rails.env
print yellow(bold("rake assets:precompile should only be run in RAILS_ENV=production, you are risking unminified assets")), "\n"
end
import UIKit
import RealmSwift
import TTTabBar
let realm = try! Realm()
let octoClient = OctolyClient(
baseUrl: "https://www.octoly.com/api",
apiVersion: "v1")
var currentUser:User? = realm.objects(User).first;
- prefix = Rails.env.production? ? '' : (Rails.env + ":")
:javascript
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0.
function drawInfoBulle (style, image, text) {
var infoBulle = document.getElementById("infoBulle"),
infoBulleImg = document.getElementById("infoBulleImg"),
infoBulleTxt = document.getElementById("infoBulleTxt");
infoBulle.style.margin = style;
infoBulleImg.innerHTML = image;
infoBulleTxt.innerHTML = text;
}
@AdrienGiboire
AdrienGiboire / gist:adc7ef08c8f8b5089dd4
Last active September 10, 2015 15:02 — forked from Huluk/gist:5117702
Open Files with Terminal Vim by default [mac, iterm]
If you want your terminal vim to open files you double click, follow the following steps (MacOS only):
1. Open Automator
2. Select Application
3. Copy the attached file
4. Save and set as default for opening files
Multiple files are opened in vim tabs.
If there is already a vim instance running, files are opened in it.
if (
(function(){
var el = document.createElement('div'),
bs = 'backgroundSize',
ubs = bs.charAt(0).toUpperCase() + bs.substr(1),
props = [bs, 'Webkit' + ubs, 'Moz' + ubs, 'O' + ubs];
for ( var i in props ) {
if ( el.style[props[i]] !== undefined ) {
return true;
[
{
type: 'doughnut',
name: 'Satisfaction',
value: 6,
max: 10,
color: '#e58d51'
},
{
type: 'doughnut',