This file contains hidden or 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
class SelfStudy | |
attr_accessor :name | |
def self | |
@name | |
end | |
def self.name | |
@name | |
end |
This file contains hidden or 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
class MyClass | |
# All of these are equivalent | |
def self.myMethod | |
true | |
end | |
def MyClass.myMethod | |
true | |
end |
This file contains hidden or 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
var bb = null; | |
function drawRect(e) | |
{ | |
var elm = e.target; | |
// fixes for 'use' elements | |
if(!elm.getBBox) | |
{ | |
if(elm.correspondingUseElement) |
This file contains hidden or 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
// Create a Signal without specific Value Classes | |
var signal:Signal = new Signal(); | |
// Add listeners | |
signal.add(myListener); | |
signal.add(myOtherListener); | |
// Dispatch signal | |
signal.dispatch(); | |
This file contains hidden or 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
photoView: SC.GridView.design({ | |
actOnSelect: YES, | |
isEnabled: YES, | |
actionBinding: 'Instagram.navigationController.showPhotoDetailsPage', | |
layout: { centerX: 0, centerY: 100, width: 900, height: 300 }, | |
columnWidth: 200, | |
rowHeight: 200, | |
This file contains hidden or 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
Clazz = function(num) { | |
var priv = num; | |
this.pub = priv; | |
that = this; | |
} | |
Clazz.prototype.outsider = function() { | |
return priv; | |
} |
This file contains hidden or 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
File file = new File("C:\\Users\\preslav\\DEsktop\\temp.jpg"); | |
byte[] bytes = new byte[file.length()]; | |
InputStream is = new FileInputStream(file); | |
int offset = 0; | |
int numRead = 0; | |
while (offset < bytes.length && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) | |
{ | |
offset += numRead; |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Newtonsoft.Json.Linq; | |
using System.Net; | |
using System.IO; | |
namespace gist | |
{ |
This file contains hidden or 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 "open-uri" | |
require "rubygems" | |
require "json" | |
USERNAME = "henrik" | |
query = ARGV.first.downcase | |
gists = JSON.parse(open("http://gist.github.com/api/v1/json/gists/#{USERNAME}").read)['gists'] |
This file contains hidden or 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
package { | |
import flash.display.MovieClip; | |
public class SuperNode extends MovieClip | |
{ | |
public var mainShape:MovieClip; | |
public function SuperNode() | |
{ | |
super(); |