Here is a list of scopes to use in Sublime Text 2/3 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
| document.addEventListener('DOMContentLoaded', function() { | |
| var checkPageButton = document.getElementById('checkPage'); | |
| checkPageButton.addEventListener('click', function() { | |
| chrome.tabs.getSelected(null, function(tab) { | |
| d = document; | |
| var f = d.createElement('form'); | |
| f.action = 'http://gtmetrix.com/analyze.html?bm'; | |
| f.method = 'post'; |
Here is a list of scopes to use in Sublime Text 2/3 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
| public interface CustomItemClickListener { | |
| public void onItemClick(View v, int position); | |
| } |
| import android.content.Context; | |
| import android.content.res.TypedArray; | |
| import android.util.AttributeSet; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.support.v7.widget.LinearLayoutManager; | |
| import android.view.View; | |
| import android.graphics.Rect; | |
| import android.graphics.drawable.Drawable; | |
| import android.graphics.Canvas; |
| /* | |
| * Copyright (C) 2014 Chris Banes | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
A summary of the Rails Guides on Routes, plus other tips.
The Rails router recognizes URLs and dispatches them to a controller's action. It can also generate paths and URLs, avoiding the need to hardcode strings in your views.
Examples
# Redirects /orders/report to orders#report.
get 'orders/report', to: 'orders#report'| <!-- | |
| 1. Download the Android Jelly Bean fonts and the Symbola font: | |
| https://www.dropbox.com/s/tvtzcnzkvbe0nrt/jelly-bean-fonts.zip | |
| http://users.teilar.gr/~g1951d/Symbola707.zip | |
| 2. unzip the files and put AndroidEmoji.ttf and Symbola.ttf (and any of the other fonts that strike your fancy) | |
| in your ~/.fonts/ directory | |
| 3. run `fc-cache -f`. You can check to make sure the new fonts | |
| were installed with `fc-list`. You'll probably want to grep the copious output for Symbola or Emoji |
| # Factorial Recursive # | |
| ####################### | |
| # Long Version: | |
| def factorial(n) | |
| if n == 0 | |
| return 1 | |
| else | |
| return n*factorial(n-1) |
| #!/usr/bin/env python | |
| # | |
| # Kefei Dan Zhou | |
| # | |
| import math | |
| # return a dict or a list of primes up to N | |
| # create full prime sieve for N=10^6 in 1 sec |