Skip to content

Instantly share code, notes, and snippets.

View JellyWX's full-sized avatar
💙
Idle

Jude Southworth JellyWX

💙
Idle
View GitHub Profile
fn main()
{
const RANGES: [i32; 10] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let mut triangles: i32 = 0;
for a in 0..RANGES.len()-2
{
for b in 1..RANGES.len()-a
{
for c in 1..RANGES.len()-a-b
PLEASE NOTE:
- We DO NOT recommend using the `Etc` timezones. Please select a real time region from the list, for example a country or city.
- Time region names are case sensitive
- Time regions don't contain spaces. The brackets at the end are for reference, and aren't a part of the name
Etc/GMT+12 (GMT -12)
Etc/GMT+11 (GMT -11)
Pacific/Midway (GMT -11)
Pacific/Niue (GMT -11)
Pacific/Pago_Pago (GMT -11)
import time
def sq_digits(n):
nums = []
div, mod = divmod(n, 10)
nums.append(mod)
while div >= 10:
div, mod = divmod(div, 10)
All languages with codes:
afrikaans (af)
albanian (sq)
amharic (am)
arabic (ar)
armenian (hy)
azerbaijani (az)
basque (eu)
belarusian (be)
const int size = 1000000;
int main()
{
bool li[size] = {false};
for ( int i = 2; i < size; ++i )
{
if ( !li[i] )
{
@JellyWX
JellyWX / connection_info.json
Last active March 19, 2018 19:51
Connection info for bot and client
{"ip" : "54.37.19.136",
"port" : 44139}
@JellyWX
JellyWX / convert_indents.cpp
Last active March 1, 2018 09:57
C++ thing for converting the indentation scale of a file
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
int main(int argc, char* argv[]) {
std::ifstream open_file;
std::ofstream output;
if (argc != 3) {
@JellyWX
JellyWX / convert_indents.py
Last active March 1, 2018 10:42
Python script converts indentation sizes for python files
import sys
try:
filename = sys.argv[1]
indents = int(sys.argv[2])
except ValueError:
raise ValueError('2nd arg must be integer')
except IndexError:
raise IndexError('Missing args')
#include <iostream>
#include <map>
int main()
{
std::string term = "";
std::map<std::string, bool> missing;
bool complete = false;
do {
@JellyWX
JellyWX / mkcpp.sh
Created September 13, 2017 20:52
C++ compile and run
#!/bin/sh
#$ main.cpp $1
g++ -std=c++11 $1 -o mkcpp_main
./mkcpp_main
rm mkcpp_main