This file contains 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 foo_app = angular.module("foo_app", []); | |
foo_app.controller("bar_controller", ["$scope", "$http", | |
function ($scope, $http){ | |
$http({ | |
method: "GET", | |
url: "api/foo/bar/", | |
}).then( | |
function successCallback(response){ | |
console.log(response); |
This file contains 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
<!doctype html> | |
<html ng-app> | |
<head> | |
<title>My Angular App</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains 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
# collects and installs each requirement fully one at a time. | |
# rather than collecting all packages then installing. | |
import pip | |
from subprocess import call | |
with open("requirements.txt", "r") as req: | |
for package in req: | |
call("pip install " + package, shell=True) |
This file contains 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
mkmanagementcommand(){ | |
# creates a new management command | |
# arg1: app name | |
mkdir $1/management; | |
touch $1/__init__.py; | |
mkdir $1/management/commands; | |
touch $1/management/commands/__init__.py; | |
touch $1/management/commands/$2.py; | |
} | |
add_ci(){ |
This file contains 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 sleep(milliseconds) { | |
var start = new Date().getTime(); | |
for (var i = 0; i < 1e7; i++) { | |
if ((new Date().getTime() - start) > milliseconds){ | |
break; | |
} | |
} | |
} | |
// sleep(1000); |
This file contains 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 is_ascii(str){ | |
for (var i = 0; i < str.length; i++) | |
if (str.charCodeAt(i) > 127) | |
return false; | |
return true; | |
} |
This file contains 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
<!-- html --> | |
<link rel="stylesheet" type="text/css" | |
href="https://fonts.googleapis.com/css?family=Lato"> | |
<!-- css --> | |
body{ | |
font-family: 'Lato', serif; | |
font-size: 110%; | |
} |
This file contains 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
<!-- button to delete an object --> | |
<% @foo.each do |f| %> | |
<%= button_to 'delete', f, method: :delete %> | |
<% end %> | |
This file contains 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
.foo{ | |
animation: foo_ani 1s; | |
} | |
@keyframes foo_ani{ | |
0%{ | |
background-color: #53E889; | |
} | |
100%{ | |
background-color: #AAF9C6; |
This file contains 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
find / -name foo.bar |