Save code snippets that work with just one click

Save code from any website. In less than 5 secs with our browser & IDE extensions that sync across platforms.

codeGet Extensions

Our users explain it best

Save Code extension is the most-cool thing I am introduced to in May and till now. And I have this enabled all the time while working or surfing to save #code with reference to the problem at hand

We as devs love code snippets. So, here's an extension for saving those magical snippets.

It has been so usefull because i can have all my snippets organized in one place and I can acces them any time for my study

Time-saver!!

It see what problems I have solved across various platform.

Instead of saving bookmarks for every interesing stuff you find, you can save exactly what matters and have it in a single place (also, tagging by language makes this better)

Ease of storing code on the go

It allows me to find my old code after it has been rewritten

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension

The Pinterest of Code

Join our community of coders together building an organized directory of code snippets that work!

<main>
	<iframe src="https://www.youtube.com/embed/KQetemT1sWc"></iframe>   
    <a href="#!" onclick="stopThis()">Stop Playing</a>
</main>

<script>
  function stopThis(){
      var iframe = container.getElementsByTagName("iframe")[0];
      var url = iframe.getAttribute('src');
      iframe.setAttribute('src', '');
      iframe.setAttribute('src', url);
  }
</script>
override func viewDidLoad() {
    super.viewDidLoad()
    // Swift block syntax (iOS 10+)
    let timer = Timer(timeInterval: 0.4, repeats: true) { _ in print("Done!") }
    // Swift >=3 selector syntax
    let timer = Timer.scheduledTimer(timeInterval: 0.4, target: self, selector: #selector(self.update), userInfo: nil, repeats: true)
    // Swift 2.2 selector syntax
    let timer = NSTimer.scheduledTimerWithTimeInterval(0.4, target: self, selector: #selector(MyClass.update), userInfo: nil, repeats: true)
    // Swift <2.2 selector syntax
    let timer = NSTimer.scheduledTimerWithTimeInterval(0.4, target: self, selector: "update", userInfo: nil, repeats: true)
}

// must be internal or public. 
@objc func update() {
    // Something cool
}
// MARK: - Properties

// MARK: - IBOutlets

// MARK: - Life cycle

// MARK: - Set up

// MARK: - IBActions

// MARK: - Navigation

// MARK: - Network Manager calls

// MARK: - Extensions
# Python3 implementation of the approach 

# Function to sort the array such that 
# negative values do not get affected 
def sortArray(a, n): 

	# Store all non-negative values 
	ans=[] 
	for i in range(n): 
		if (a[i] >= 0): 
			ans.append(a[i]) 

	# Sort non-negative values 
	ans = sorted(ans) 

	j = 0
	for i in range(n): 

		# If current element is non-negative then 
		# update it such that all the 
		# non-negative values are sorted 
		if (a[i] >= 0): 
			a[i] = ans[j] 
			j += 1

	# Print the sorted array 
	for i in range(n): 
		print(a[i],end = " ") 


# Driver code 

arr = [2, -6, -3, 8, 4, 1] 

n = len(arr) 

sortArray(arr, n) 

Text("Border test",
    style: TextStyle(
      inherit: true,
      fontSize: 48.0,
      color: Colors.pink,
      shadows: [
        Shadow( // bottomLeft
          offset: Offset(-1.5, -1.5),
          color: Colors.white
        ),
        Shadow( // bottomRight
          offset: Offset(1.5, -1.5),
          color: Colors.white
        ),
        Shadow( // topRight
          offset: Offset(1.5, 1.5),
          color: Colors.white
        ),
        Shadow( // topLeft
          offset: Offset(-1.5, 1.5),
          color: Colors.white
        ),
      ]
    ),
);
class Solution(object):
    def letterCombinations(self, digits):
        """
        :type digits: str
        :rtype: List[str]
        """
        
import UIKit

extension UITableView {
    
    func dequeueReusableCell<T: UITableViewCell>() -> T {
        return dequeueReusableCell(withIdentifier: NSStringFromClass(T.self)) as! T
    }
}

//using: let cell: ExampleTableViewCell = tableView.dequeueReusableCell()
module.exports = leftpad;
function leftpad (str, len, ch){
   str = String(str);
   var i = -1;
   if (!ch && ch !== 0) ch = ' ';
   len = len - str.length;
   while (++i < len){
      str = ch + str;
   }
   return str;
}
quicksort :: Ord a => [a] -> [a] 
quicksort [] = [] 
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater) 
  where 
     lesser = filter (< p) xs 
     greater = filter (>= p) xs

Start saving & organizing your code

web_developer
Sign up here