Skip to content

Instantly share code, notes, and snippets.

@freddiebabord
freddiebabord / AutoSaveEditor.cs
Last active April 25, 2018 19:22
Auto-Save Modified Scenes and Assets with sudo version history in Unity
// ===============================
// AUTHOR : Frederic Babord
// CREATE DATE : 24th April 2018
// PURPOSE : Auto-Save Modified Scenes and Assets in Unity
// SPECIAL NOTES : This script requires Asyncronous functions which REQUIRES C# 6.0 and .NET 4.6 which is
// experimental in Unity 2017 and stable in Unity 2018.
// MINIMUM Unity Version: 2017
// Needs to be placed in an Editor folder
// ===============================
// Change History:
@amirrajan
amirrajan / usage.rb
Last active March 24, 2016 11:38
Poor Man's Android View Generation with RM
class MainActivity < Android::App::Activity
include ViewGeneration
def generate_screen
root_view(
horizontal_layout(:row0, text_view(:title, "a dark room")),
horizontal_layout(:row1,
hidden_button(:outside_button, "a silent forest"),
hidden_button(:embark_button, "a dusty path")
),
@raggi
raggi / rack_sse.ru
Last active March 23, 2024 11:10
Rack SSE Example
# rack_sse.ru
#
# An example of basic real-time, single-room broadcast chat using Server Sent
# Events in plain old Rack. This example does NOT use hijack, or the async
# hacks, it just relies on a well implemented threaded Rack server (at time of
# writing this will therefore only work with puma!). Other servers should be
# fixed to support this, as it is pretty critical to how Rack *should* work on
# most servers. The only spec-acceptable failure in this case is not flushing
# the content stream on each yield (for which the rack spec has no workaround
# today).
@emad-elsaid
emad-elsaid / gmail2tumblr.rb
Created March 6, 2014 12:19
gmail to tumblr posting script
#!/usr/bin/env ruby
require 'mail' # gem install mail --no-document
# Credit to :
# http://stackoverflow.com/questions/12884711/how-to-send-email-via-smtp-with-rubys-mail-gem
def ask question
print "#{question} ? : "
$stdin.gets.chomp!
end
@robertjwhitney
robertjwhitney / activeadmin_sortable.js.coffee
Created July 3, 2012 03:37
Simple drag/drop reordering of records in an ActiveAdmin view table
# http://stackoverflow.com/a/8936202
#
# ActiveAdmin already includes the necessary jquery in active_admin/base,
# so just add this to javascripts/active_admin.js after //= require active_admin/base
#
#
# Serialize and Sort
#
# model_name - you guessed it, the name of the model we are calling sort on.
# This is the actual variable name, no need to change it.