Skip to content

Instantly share code, notes, and snippets.

View cbilgili's full-sized avatar

Canbey Bilgili cbilgili

  • Istanbul
View GitHub Profile
@kakra
kakra / filter_payment_methods.rb
Created October 14, 2010 22:10
Filter payment methods in Spree depending on the shipping name
# Filter payment methods in Spree depending on the shipping name,
# use the following snippet within your activation method to
# make it work:
#
# CheckoutsController.class_eval { include FilterPaymentMethods }
#
# The magic happens within the InstanceMethods module, change the
# regexp to fit your needs.
#
# Kai Krakow, http://github.com/kakra
@Jesus
Jesus / deploy.rb
Last active June 2, 2016 23:31 — forked from buntine/deploy.rb
# Clear existing task so we can replace it rather than "add" to it.
Rake::Task["deploy:compile_assets"].clear
desc "Precompile assets locally and then rsync to web servers"
task :compile_assets do
# compile assets locally
run_locally do
with rails_env: fetch(:stage) do
execute :bundle, "exec rake assets:precompile"
end
@buntine
buntine / deploy.rb
Created July 14, 2014 01:36
Rails 4, Capistrano 3.2.1+ local precompilation using rsync
# Clear existing task so we can replace it rather than "add" to it.
Rake::Task["deploy:compile_assets"].clear
desc "Precompile assets locally and then rsync to web servers"
task :compile_assets do
on roles(:web) do
rsync_host = host.to_s
run_locally do
with rails_env: :production do ## Set your env accordingly.
@andrewgleave
andrewgleave / ContentEditableLabel.js
Last active September 15, 2016 09:32
An editable React.js label element based on the contenteditable attribute
/** @jsx React.DOM */
'use strict';
var React = require('react');
var ContentEditableLabel = React.createClass({
propTypes: {
tag: React.PropTypes.func,
@puf
puf / index.android.js
Created December 14, 2015 17:51
Simple example of a React Native chat app for Android (using Firebase)
'use strict';
var React = require('react-native');
var Firebase = require('firebase');
var {
AppRegistry,
StyleSheet,
Text,
View,
TextInput,
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@flunder
flunder / iconExample.js
Last active September 26, 2017 16:11
An example gist trying to show how to implement an icon within a tcomb form in react-native
const Form = t.form.Form;
const postOptions = t.struct({
publication: t.String,
tags: t.String,
more: t.String,
facebook: t.Boolean
})
const options = {
"""
Programming task
================
The following is an implementation of a simple Named Entity Recognition (NER).
NER is concerned with identifying place names, people names or other special
identifiers in text.
Here we make a very simple definition of a named entity: A sequence of
at least two consecutive capitalized words. E.g. "Los Angeles" is a named
@ckgagan
ckgagan / Rails Date Formats
Created April 3, 2012 06:01
Rails Date Formats
Rails Date Formats – strftime
StrFTime Format Codes for Ruby on Rails
Year
%Y year with century 2007
%y year without century 07
%C century number (year divided by 100) 20
Month
%B full month name January
@PillowUnicorn
PillowUnicorn / ios-bitrise.yml
Created April 28, 2017 22:29
Pillow's iOS bitrise.yml
---
format_version: 1.1.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
app:
envs:
- BITRISE_PROJECT_PATH: ios/pro_mobile.xcodeproj
opts:
is_expand: false
- BITRISE_SCHEME: pro_mobile
opts: