This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import <AppKit/CPView.j> | |
CPTextViewDidFocusNotification = @"CPTextViewDidFocusNotification"; | |
CPTextViewDidBlurNotification = @"CPTextViewDidBlurNotification"; | |
@implementation CPTextView : CPControl | |
{ | |
DOMElement _inputElement; | |
id _delegate; | |
CPScrollView _scrollView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// Sync two dirs giving precedence to the machine with the most recently modified files. | |
// After the first sync we sync again with the opposite precedence to make sure files | |
// deleted on either machine stay gone. | |
// | |
// The (primary) problem with this approach is that the newest changes always win. If | |
// you edit a file on both machines the latest changes will be the *only* remaining | |
// changes. Be careful if you actually use this! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/macruby | |
# This example is done with MacRuby and the UIKit framework for Mac OS X | |
# http://chameleonproject.org/ | |
# https://github.com/BigZaphod/Chameleon/ | |
framework 'Cocoa' | |
framework "UIKit" # garbage collected version, the current version of Chameleon ist not known to be GC-safe | |
################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
framework 'AppKit' | |
class Download | |
attr_reader :response, :responseBody | |
def start(request) | |
puts "START!" | |
NSURLConnection.connectionWithRequest(request, delegate:self) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; The Datomic schema is made up of Datomic data, so you manipulate it | |
;; with ordinary queries and transactions -- and with ordinary code | |
;; in Java or Clojure. | |
;; query rule that finds attributes in schema whose names start with ?prefix | |
;; note the Java interop call to .startsWith | |
;; you could create a similar rule for namespace prefixes | |
(def rules '[[[attr-starts-with ?prefix ?attr] | |
[?e :db/valueType] | |
[?e :db/ident ?attr] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns space-age) | |
(defn on-earth [seconds] | |
(/ seconds 31557600.0)) | |
(def orbital-periods | |
{:mercury 0.2408467 | |
:venus 0.61519726 | |
:mars 1.8808158 | |
:jupiter 11.862615 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns react-cljs.core | |
(:require-macros [reactjs.macros :refer [pure]]) | |
(:require React [reactjs.core :as r])) | |
(enable-console-print!) | |
(declare render-ui) | |
(defn render-counter [id state cb] | |
(pure state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns docker-tag-paginate | |
(:require [clj-http.lite.client :as client] | |
[cheshire.core :as json] | |
[clojure.pprint :refer [print-table]])) | |
(def base-url "https://registry.hub.docker.com/v2") | |
;; (progression pos? dec 15) | |
(defn progression |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
require 'net-ldap' | |
require 'digest/sha1' | |
require 'base64' | |
require 'haml' | |
LDAP_HOST = 'localhost' | |
ADMIN_DN = 'cn=admin,dc=company,dc=com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fog' | |
bucket = 'bucket-name' | |
credentials = { | |
:provider => 'AWS', | |
:aws_access_key_id => 'access_key_id', | |
:aws_secret_access_key => 'secret_key', | |
} | |
fog = Fog::Storage.new(credentials) |
OlderNewer