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
| function isCosoleOpen() { | |
| console.profile(); | |
| console.profileEnd(); | |
| if(console.clear) { console.clear() }; | |
| return console.profiles.length > 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
| #!/bin/sh | |
| DB=YOUR_DB_NAME | |
| USER=DB_USER | |
| PASSWORD=DB_PASS | |
| BACKUP_DIR=~/db_backups/$DB | |
| [ -d "$BACKUP_DIR" ] || mkdir -p "$BACKUP_DIR" |
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
| setBackground() { | |
| osascript -e "tell application \"iTerm\" | |
| set myterm to (current terminal) | |
| tell myterm | |
| set mysession to (current session) | |
| tell mysession | |
| set background color to $1 | |
| end tell | |
| end tell | |
| end tell" |
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
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
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
| Directives | |
| ========== | |
| Directive calls controller | |
| ------------------------- | |
| app.controller("AppCtrl", function($scope) { | |
| $scope.func = function() { | |
| alert("Controller's function published on scope"); | |
| } | |
| } |
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
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |
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
| /*! | |
| * jQuery JavaScript Library v1.4.1 | |
| * http://jquery.com/ | |
| * | |
| * Copyright 2010, John Resig | |
| * Dual licensed under the MIT or GPL Version 2 licenses. | |
| * http://jquery.org/license | |
| * | |
| * Includes Sizzle.js | |
| * http://sizzlejs.com/ |
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 els = document.getElementsByClassName("yt-simple-endpoint"); | |
| var links = {}; | |
| for (var e in els ) { | |
| if( els[e].href && els[e].href.indexOf('watch')!=-1 ) { | |
| var link = els[e].href.split('&list')[0]; | |
| links[link] = link; | |
| } | |
| } | |
| for(var l in Object.keys(links)) { | |
| console.log(l); |
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
| // lighthouse-batch -s -p "--perf --quiet" -f urls-boats.txt -o report-lvb | |
| var parsedJSON = require('./report-lvb/summary.json'); | |
| var worst = []; | |
| var seventies = []; | |
| var eighties = []; | |
| var nineties = []; | |
| console.log('Total: '+parsedJSON.length); | |
| for (var r in parsedJSON) { | |
| var row = parsedJSON[r]; |
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
| // Cross-broswer implementation of text ranges and selections | |
| // documentation: http://bililite.com/blog/2011/01/17/cross-browser-text-ranges-and-selections/ | |
| // Version: 2.6 | |
| // Copyright (c) 2013 Daniel Wachsstock | |
| // MIT license: | |
| // Permission is hereby granted, free of charge, to any person | |
| // obtaining a copy of this software and associated documentation | |
| // files (the "Software"), to deal in the Software without | |
| // restriction, including without limitation the rights to use, | |
| // copy, modify, merge, publish, distribute, sublicense, and/or sell |
OlderNewer