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
| # apktool d -s sample.apk sample | |
| # cd sample | |
| # vi AndroidManifest.xml | |
| - Add android:versionCode="1" to manifest tag | |
| - Add android:versionName="1.0" to manifest tag | |
| - Delete android:debuggable="true" from application tag | |
| # apktool b sample sample-m.apk | |
| # jarsigner -keystore sample.keystore -signedjar sample-s.apk sample-m.apk alias |
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
| // ==UserScript== | |
| // @title ekitan | |
| // @description Automatically fill out the boarding station. | |
| // @namespace http://blog.champierre.com | |
| // @include http://ekitan.com/ | |
| // ==/UserScript== | |
| document.getElementById('sfname').value = '柴崎'; | |
| document.getElementById('stname').select(); |
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
| image = UIImage.imageNamed("icon.png") | |
| @image_view = UIImageView.alloc.initWithImage(image) | |
| @image_view.frame = CGRectMake(0, 0, 36, 36) | |
| view.addSubview(@image_view) |
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 AppDelegate | |
| def application(application, didFinishLaunchingWithOptions:launchOptions) | |
| @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
| @window.backgroundColor = UIColor.whiteColor | |
| label = UILabel.alloc.initWithFrame @window.frame | |
| label.textAlignment = UITextAlignmentCenter | |
| label.text = "Tap!" | |
| BubbleWrap::HTTP.get("http://www.geognos.com/api/en/countries/info/all.json") do |response| |
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
| NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"custom user agent", @"UserAgent", nil]; | |
| [[NSUserDefaults standardUserDefaults] registerDefaults:dictionary]; | |
| [dictionary release]; |
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 appbar = document.getElementById("appbar"); | |
| var button = document.createElement("button"); | |
| button.setAttribute("data-win-control", "WinJS.UI.AppBarCommand"); | |
| // id, label, icon are dynamically set. button.setAttribute("type", "button"); | |
| button.setAttribute("data-win-options", "{id:'" + id + "', label:'" + label + "', icon:'" + icon + "'}"); | |
| WinJS.UI.process(button); appbar.appendChild(button); |
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
| == in the page in iframe | |
| <script type="text/javascript"> | |
| window.attachEvent("onmessage", receiveMessage); | |
| function receiveMessage(e) { | |
| if (e.data == "refresh") { | |
| history.go(0); | |
| } | |
| } |
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
| # e.g. | |
| # brightness("#ffffff") = (255/255.0 + 255/255.0 + 255/255.0)/3.0 = 1.0 | |
| # brightness("#000000") = (0/255.0 + 0/255.0 + 0/255.0)/3.0 = 0.0 | |
| # brightness("#666666") = (102/255.0 + 102/255.0 + 102/255.0)/3.0 = 0.4 | |
| def brightness(color): | |
| rgb = struct.unpack('BBB', color[1:].decode('hex')) | |
| brightness = 0 | |
| for x in rgb: | |
| brightness += x / 255.0 | |
| return brightness / 3.0 |
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
| $('img#icon').attr('src', 'https://si0.twimg.com/profile_images/3340669721/467addf220d4d1383fa025996cb09d49_bigger.png'); |
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 "scratchrsc" | |
| class PrintRSC < RSCWatcher | |
| def on_broadcast(name) # when a broadcast is sent | |
| puts "broadcast #{name}" # print it to the screen | |
| end | |
| def on_sensor_update(name,value) # when a variable or sensor is updated | |
| puts "#{name} = #{value}" # print the change to the screen | |
| if name == "test" | |
| @test = value |