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
############################################################################################### | |
## ## | |
## Setup ## | |
## ## | |
############################################################################################### | |
# install.packages("Rfacebook") # from CRAN | |
# install.packages("Rook") # from CRAN | |
# install.packages("igraph") # from CRAN |
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
package ca.uwo.csd.cs2212.USERNAME; | |
public class BankAccount { | |
private double balance; | |
public BankAccount(double balance) { | |
this.balance = balance; | |
} |
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
# If you worked with React and JSX you probably noticed that you can't use JS comments when inside JSX sections | |
# Add this to your Atom init script | |
# Then add 'ctrl-cmd-/': 'comment-jsx' to your keymap.cson | |
# Then when you are on a JS/JSX file, just press cmd+ctrl+/ to use JSX-style comments that work with JSX elements | |
# Is not the most efficient way, but it's the cleanest and reliable one | |
atom.commands.add 'atom-workspace', 'comment-jsx', -> | |
atom.config.set('editor.commentStart', '{/*', {scopeSelector: '.source.js.jsx'}) | |
atom.config.set('editor.commentEnd', '*/}', {scopeSelector: '.source.js.jsx'}) | |
for selection in atom.workspace.getActiveTextEditor().selections |
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
from django import forms | |
from django.contrib.postgres.fields import ArrayField | |
class ChoiceArrayField(ArrayField): | |
""" | |
A field that allows us to store an array of choices. | |
Uses Django 1.9's postgres ArrayField | |
and a MultipleChoiceField for its formfield. |
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
Name: Flash | |
Serial: eNrzzU/OLi0odswsqnHLSSzOqDGoca7JKCkpsNLXLy8v1ytJTczVLUotKNFLzs8FAJHYETc= | |
if anyone wants to thank ETH: 0x527c2aB55b744D6167dc981576318af96ed26676 | |
Thank you! |
Increases indentation on the file tree and adds some lines to each directory/file.
Works 15 levels deep, but you can expand it by just adding more of each line thats repeating, i.e.:
- add another box shadow
(n*-20px) 0 0 0 rgba(255, 255, 255, 0.4)
- add another padding-left
.monaco-tree-row[aria-level="n"] { padding-left: ((n-1)*20)px; }
- add another :before & :after with left positioning
.monaco-tree-row[aria-level="n"]:before { left: (((n-1)*20)-9)px; }
.monaco-tree-row[aria-level="n"]:after { left: (((n-1)*20)-9)px; }
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 numDaysBetween = function(d1, d2) { | |
var today = d2.getTime() / 1000 | |
console.log('today', today) | |
var diff = Math.abs(d1 - (d2.getTime() / 1000)); | |
console.log('diff', diff) | |
return diff / (60 * 60 * 24); | |
}; | |
var d1 = 1497294888; // June 12, 2017 | |
var d2 = new Date(); // Today |
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
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event)) | |
}) | |
/** | |
* Entry point of the worker | |
*/ | |
async function handleRequest(event) { | |
try { | |
// Get the JWT |