⭐ = favorite
Paul Ford: What Is Code? - It’s long but nothing ever got me so excited about learning to code as much as this.
- Free (mostly)
#!/bin/python3 | |
import re | |
n = int(input().strip()) | |
s = "{0:b}".format(n) | |
out = max(len(a) for a in re.findall(r'1+', s)) | |
print(out) |
#!/usr/bin/env python3 | |
""" | |
Essentially just a python script to run the sql command below. | |
mysqlimport --ignore-lines=1 --fields-terminated-by=, --columns=csv_headers --local -u root -p db_name file.csv | |
""" | |
using System; | |
public class HelloWorld | |
{ | |
private const string Greetings = "Hello, World!"; | |
public string Hello() | |
{ | |
return Greetings; | |
} |
#!/usr/bin/env bash | |
set -o errexit | |
set -o nounset | |
main() { | |
echo "Hello, World!" | |
} | |
main |
(ns hello-world) | |
(defn hello [] "Hello, World!" ) |
using System; | |
public static class Leap | |
{ | |
public static bool IsLeapYear(int year) | |
{ | |
bool multipleOf4 = YearIsDivisibleByFactor(year, 4); | |
bool multipleOf100 = YearIsDivisibleByFactor(year, 100); | |
bool multipleOf400 = YearIsDivisibleByFactor(year, 400); |
require('dotenv').config(); | |
const { AsyncParser } = require('json2csv'); | |
const fs = require('fs'); | |
const MongoClient = require('mongodb').MongoClient; | |
const url = `mongodb://localhost:27017`; | |
const HEADERS = ['first_name', 'last_name', 'middle_name', 'id']; | |
const FIELDS = ['name.first_name', 'name.last_name', 'name.middle_name', 'id']; |
import glob | |
files = glob.glob("*.csv") | |
header_saved = False | |
with open('output.csv', 'w') as fout: | |
for file in files: | |
with open(file) as fin: | |
header = next(fin) | |
if not header_saved: |
#!/usr/local/bin/python3 | |
# List tasks with fab2 -l | |
import os | |
import os.path as path | |
from fabric2 import Config, Connection, task | |
import patchwork.transfers as transfer | |
# Define values in .env file. |
⭐ = favorite
Paul Ford: What Is Code? - It’s long but nothing ever got me so excited about learning to code as much as this.