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
$list: pouria josh mladen mason daniel | |
=author-image | |
@each $author in $list | |
.photo-#{$author} | |
background: image-url("avatars/#{$author}.png") | |
.author-bio | |
+author-image |
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 video = document.getElementById('video'), | |
info = document.getElementById('info'), | |
fraction = 0.8; | |
function checkScroll() { | |
var x = video.offsetLeft, | |
y = video.offsetTop, | |
w = video.offsetWidth, | |
h = video.offsetHeight, | |
r = x + w, //right |
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() { | |
function filterPath(string) { | |
return string | |
.replace(/^\//,'') | |
.replace(/(index|default).[a-zA-Z]{3,4}$/,'') | |
.replace(/\/$/,''); | |
} | |
var locationPath = filterPath(location.pathname); |
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 databaseUrl = "mongolaburl"; // "username:[email protected]/mydb" | |
var collections = ["Persons"]; | |
var db = require("mongojs").connect(databaseUrl, collections); | |
//Find a Person | |
db.Persons.find({sex: "male"}, function(err, users) { | |
if( err || !users) console.log("No male users found"); | |
else users.forEach( function(maleUser) { | |
console.log(maleUser); | |
} ); |
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
sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/bin/subl |
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
I have marked with a * those which I think are absolutely essential | |
Items for each section are sorted by oldest to newest. Come back soon for more! | |
BASH | |
* In bash, 'ctrl-r' searches your command history as you type | |
- Input from the commandline as if it were a file by replacing | |
'command < file.in' with 'command <<< "some input text"' | |
- '^' is a sed-like operator to replace chars from last command | |
'ls docs; ^docs^web^' is equal to 'ls web'. The second argument can be empty. | |
* '!!:n' selects the nth argument of the last command, and '!$' the last arg |
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
sudo ln -F /System/Library/Frameworks/JavaScriptCore.framework/Versions/Current/Resources/jsc /usr/bin |
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
1. Allow the other user account to locate directories that it has access to within your home directory. | |
setfacl -m u:secondary_username:--x $HOME | |
2. Remove the other user’s default access to the applications | |
setfacl -m u:secondary_username:--- $HOME/webapps/new_app | |
3. Grant the user read, write, and execute access to the application’s files and directories |
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
tar -czf ./backup.tar.gz . --exclude ./backup.tar.gz |
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 Requires: | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.6.0/redux.js"></script> | |
*/ | |
const counter = (state = 0, | |
action) => { | |
switch (action.type) { | |
case 'INCREMENT': | |
return state + 1; |
OlderNewer