sudo apt install python-pip
sudo apt install python3-pip
pip --version
pip3 --version
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 | |
/** | |
* UserFrosting (http://www.userfrosting.com) | |
* | |
* @link https://github.com/userfrosting/UserFrosting | |
* @copyright Copyright (c) 2013-2017 Alexander Weissman | |
* @license https://github.com/userfrosting/UserFrosting/blob/master/licenses/UserFrosting.md (MIT License) | |
*/ | |
namespace UserFrosting\Sprinkle\Core\Model\Relations; |
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
#!/bin/sh | |
################################################################################ | |
## ## | |
## The Art of Computer Programming by Donald E. Knuth. ## | |
## ## | |
################################################################################ | |
## Volume 1 - Fundamental Algorithms, 3rd Edition |
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
/// Rust Fibonacci one-liner using `fold` | |
/// | |
/// Not very practical: only for one time use, | |
/// since it will have to re-calculate all terms again and again | |
/// if used in a loop to create multiple items. | |
/// The use of `_` also suggests this is not an ideal solution. | |
fn main() { | |
let n = 10; | |
let x = (0..n).fold((0, 1), |x, _| (x.0+x.1, x.0)).0; | |
println!("{}: {}", n, x); |
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
// upload.js, from https://github.com/googledrive/cors-upload-sample | |
// Contributors Steve Bazyl, Mike Procopio, Jeffrey Posnick, Renaud Sauvain | |
// License: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Implements Resumable Upload for Google Drive as described by | |
// https://developers.google.com/drive/v3/web/resumable-upload | |
// | |
// Modified by Paul Brewer, Economic and Financial Technology Consulting LLC | |
// Nov. 1 2017 | |
// 1. use Google Drive API V3 instead of V2 |
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
extern crate rand; | |
use std::iter::Iterator; | |
use std::collections::HashMap; | |
use rand::{thread_rng, Rng}; | |
macro_rules! s { | |
($x: expr) => { | |
$x.to_owned() | |
}; |
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 tribonacci_triangle(n): | |
# n <- number of rows to generate | |
# a <- tribonacci triangle | |
a = [[1], [1, 1]] | |
if n == 1: | |
return [[1]] | |
elif n == 2: | |
return a | |
else: | |
# generate rows 3 to n |
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
#!/bin/bash | |
echo "setting frame buffer" && | |
xrandr --fb 12800x2880 && | |
echo "setting laptop monitor" && | |
xrandr --output eDP-1-1 --mode 3840x2160 --rate 60 --primary&& | |
echo "setting 27 inch monitor" && | |
xrandr --output DP-0.2 --mode 2560x1440 --scale-from 5120x2880 --panning 5120x2880+3840+0 --right-of eDP-1-1 && | |
echo "setting the samsung monitor" && | |
xrandr --output DP-0.1 --mode 1920x1080 --scale-from 3840x2160 --panning 3840x2160+8960+0 --right-of DP-0.2&& | |
echo "setting global scaling to 2x" && |
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
# put the following in a udev rule file | |
# for example /etc/udev/rules.d/99-tb16-dock.rule | |
ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{device_name}=="Dell Thunderbolt Dock", RUN+="/bin/systemctl --no-block start configure-tb16-dock.service" |
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
"""Download sentry data. | |
usage: | |
python download_sentry_data.py <org>/<project> <api_key> | |
""" | |
import requests | |
import csv | |
import sys | |
if __name__ == '__main__': |