Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Marcus Shepherd marcusshepp

🎯
Focusing
View GitHub Profile
View angular_cdn.html
<!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>
@marcusshepp
marcusshepp / pip_install_solution.py
Created May 2, 2016
when pip installing a requirements file fails on something stupid
View pip_install_solution.py
# 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)
View techops_bash_funcs.sh
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(){
View js_sleep_func.js
function sleep(milliseconds) {
var start = new Date().getTime();
for (var i = 0; i < 1e7; i++) {
if ((new Date().getTime() - start) > milliseconds){
break;
}
}
}
// sleep(1000);
@marcusshepp
marcusshepp / is_ascii.js
Created May 2, 2016
Javascript check for non-ascii chars
View is_ascii.js
function is_ascii(str){
for (var i = 0; i < str.length; i++)
if (str.charCodeAt(i) > 127)
return false;
return true;
}
View google_fonts.html
<!-- html -->
<link rel="stylesheet" type="text/css"
href="https://fonts.googleapis.com/css?family=Lato">
<!-- css -->
body{
font-family: 'Lato', serif;
font-size: 110%;
}
View animate_example.css
.foo{
animation: foo_ani 1s;
}
@keyframes foo_ani{
0%{
background-color: #53E889;
}
100%{
background-color: #AAF9C6;
@marcusshepp
marcusshepp / find_a_file.sh
Created May 11, 2016
Find a file in bash
View find_a_file.sh
find / -name foo.bar
@marcusshepp
marcusshepp / gen_pub_key.sh
Created May 13, 2016
generating a public ssh-key on Mac OS X
View gen_pub_key.sh
ssh-keygen -t rsa && cat ~/.ssh/id_rsa.pub
View rails_notes.html.erb
<!-- button to delete an object -->
<% @foo.each do |f| %>
<%= button_to 'delete', f, method: :delete %>
<% end %>
You can’t perform that action at this time.