- Add in markdown parsing for snippet posts.
- Allow users to create their own posts (will have to add in some moderation for this).
- Allow users to organize their posts by category (i.e. php, python, javascript, etc.).
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 now = new Date(); // whatever datetime object you're grabbing from | |
var parseMonth = now.getMonth() + 1; // months start in zero for some reason | |
var month = parseMonth.toString(); | |
var day = now.getDate().toString(); | |
var year = now.getFullYear().toString(); | |
// grabs current date in string -> add this to whatever element in DOM. | |
var currentDateText = month + "/" + day + "/" + year; | |
console.log(currentDateText); |
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
package main | |
import ( | |
"fmt" | |
"html/template" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"os" | |
) |
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
<?php | |
$errors = array(); | |
$formNames = array( | |
"first_name", | |
"last_name", | |
// add more form fields | |
); |
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
// promises in JS | |
var timer = new Promise((resolve, reject) => { | |
console.log("Init promise"); | |
setTimeout(() => { | |
console.log("timeout done"); | |
resolve(); | |
}, 5000); | |
}); |
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
def close_az(thing): | |
letters = list(thing) # turn string thing into list (array) | |
for l in letters: | |
# yo a close to z logic | |
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
<?php | |
// psr-2 namespaces and shit | |
class User extends Model { | |
public function roles() | |
{ | |
return $this->belongsToMany('App\Role', 'roles_users'); | |
} | |
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
def all_entry_hours(): | |
entries = client.entries(7731168, 20150402, 20151115) | |
results = [] | |
for entry in entries: | |
h = entry['day_entry']['hours'] | |
results.append(h) | |
print sum(results) |
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
import json | |
import harvest | |
# harvest config | |
def get_project(project_id): | |
p = client.get_project(project_id) | |
if project_id != p: | |
raise ValueError('Project does not exist') | |
else: |
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
<?php | |
namespace Wiki; | |
use Some\Markdown\Converter as Markdown; | |
use Illuminate\Database\Eloquent\Model; | |
use User; // assuming I have a user model | |
use Post; // assuming I have a post model | |
/** |
NewerOlder